示例#1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Cookies["loginreferrer"].Value   = "/admin/asset/asset_category_burnin_and_deployment_steps.aspx";
            Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
            if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
            }
            else
            {
                Response.Redirect("/admin/login.aspx");
            }
            oAssetCategory = new AssetCategory(intProfile, dsn);
            oAssetCategoryDeploymentConfig = new AssetCategoryDeploymentConfig(intProfile, dsn);
            oService      = new Services(intProfile, dsn);
            oStatusLevels = new StatusLevels(intProfile, dsn);
            if (!IsPostBack)
            {
                LoadList();

                if (Request.QueryString["AssetCategoryId"] != null && Request.QueryString["AssetCategoryId"] != "")
                {
                    ddlAssetCategory.SelectedValue = Request.QueryString["AssetCategoryId"].ToString();
                }

                btnUpdate.Attributes.Add("onclick", "return ValidateDropDown('" + ddlAssetCategory.ClientID + "','Please select asset category')" +
                                         " && confirm('Are you sure you want to update deployments steps ?')" +
                                         ";");
                btnService.Attributes.Add("onclick", "return OpenWindow('SERVICEBROWSER','" + hdnServiceId.ClientID + "','&control=" + hdnServiceId.ClientID + "&controltext=" + txtService.ClientID + "',false,400,600);");
                btnAddService.Attributes.Add("onclick", "return ValidateHidden0('" + hdnServiceId.ClientID + "','" + btnService.ClientID + "','Please select service');");
                PopulateConfigurations();
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Visible)
     {
         if (Request.Cookies["profileid"] != null && Request.Cookies["profileid"].Value != "")
         {
             intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
         }
         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);
         }
         oDataPoint      = new DataPoint(intProfile, dsn);
         oUser           = new Users(intProfile, dsn);
         oServiceRequest = new ServiceRequests(intProfile, dsn);
         oService        = new Services(intProfile, dsn);
         oFunction       = new Functions(intProfile, dsn, intEnvironment);
         oStatusLevel    = new StatusLevels();
         oProject        = new Projects(intProfile, dsn);
         oLog            = new Log(intProfile, dsn);
         int intProjectID = 0;
         if (intProjectId != null)
         {
             Int32.TryParse(intProjectId.ToString(), out intProjectID);
         }
         oLog.AddEvent("PROJECT_SEARCH", "", oProject.Get(intProjectID, "number") + ": ServiceProgression started at " + DateTime.Now.ToString(), LoggingType.Debug);
         LoadServiceProgression();
         oLog.AddEvent("PROJECT_SEARCH", "", oProject.Get(intProjectID, "number") + ": ServiceProgression finished at " + DateTime.Now.ToString(), LoggingType.Debug);
     }
 }
示例#3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage            = new Pages(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oCustomized      = new Customized(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oStatusLevel     = new StatusLevels(intProfile, dsn);
            if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
            {
                intPage = Int32.Parse(Request.QueryString["pageid"]);
            }
            strRedirect   = oPage.GetFullLinkRelated(intPage);
            lblTitle.Text = oPage.Get(intPage, "title");
            lblPage.Text  = "1";
            lblSort.Text  = "";

            if (Request.QueryString["page"] != null && Request.QueryString["page"] != "")
            {
                lblPage.Text = Request.QueryString["page"];
            }
            if (Request.QueryString["sort"] != null && Request.QueryString["sort"] != "")
            {
                lblSort.Text = Request.QueryString["sort"];
            }
            lblTopPaging.Text = "";

            LoadDefaultValues();
            LoadPaging(Int32.Parse(lblPage.Text), lblSort.Text);
        }
示例#4
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);
            oStatusLevel = new StatusLevels(intProfile, dsn);
            oAssetOrder  = new AssetOrder(intProfile, dsn, dsnAsset, intEnvironment);

            oLocation         = new Locations(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);



            oRequest         = new Requests(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(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"] != "")
            {
                intPlatform = Int32.Parse(Request.QueryString["id"]);
            }

            intPlatform = 1;
            if (intPlatform != 0)
            {
                pnlAllow.Visible = true;
                if (!IsPostBack)
                {
                    LoadDefaultValues(intPlatform);

                    btnApplyFilter.Attributes.Add("onclick", "return ValidateDate('" + txtStartDate.ClientID + "','Please enter start date')" +
                                                  " && ValidateDate('" + txtEndDate.ClientID + "','Please enter end date')" +
                                                  ";");
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(typeof(Page), "loadCurrentTab", "<script type=\"text/javascript\">window.top.LoadCurrentTab();<" + "/" + "script>");
                }
            }
            else
            {
                pnlDenied.Visible = true;
            }
        }
示例#5
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();;");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            Master.Page.Title = "DataPoint | Service Search";
            if (Request.Cookies["profileid"] != null && Request.Cookies["profileid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            }
            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);
            }

            oDataPoint       = new DataPoint(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oUser            = new Users(intProfile, dsn);
            oModel           = new Models(intProfile, dsn);
            oApplications    = new Applications(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oPage            = new Pages(intProfile, dsn);
            oStatusLevel     = new StatusLevels();
            oConfidence      = new Confidence(intProfile, dsn);
            Response.Cookies["storage"].Value      = "0";
            Response.Cookies["applications"].Value = "0";



            if (oUser.IsAdmin(intProfile) == true || (oDataPoint.GetPagePermission(intApplication, "SERVICE") == true || intDataPointAvailableService == 1))
            {
                if (Request.QueryString["advanced"] != null && Request.QueryString["advanced"].ToString() == "true")
                {
                    boolAdvSearch = true;
                }

                if (!IsPostBack)
                {
                    if (Request.QueryString["search"] != null && Request.QueryString["search"].ToString() == "request")
                    {
                        ddlSearchType.ClearSelection();
                        ddlSearchType.Items.FindByValue("request").Selected = true;
                    }
                    else if (Request.QueryString["search"] != null && Request.QueryString["search"].ToString() == "design")
                    {
                        ddlSearchType.ClearSelection();
                        ddlSearchType.Items.FindByValue("design").Selected = true;
                    }
                    LoadList();
                }



                //Set controls and add attributes
                setControls();
                AddControlAttributes();
            }
            else
            {
                pnlDenied.Visible = true;
            }
        }
        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);
            oDocument        = new Documents(intProfile, dsn);
            oStatusLevel     = new StatusLevels(intProfile, dsn);
            oAssetOrder      = new AssetOrder(intProfile, dsn, dsnAsset, intEnvironment);
            oAsset           = new Asset(0, dsnAsset, dsn);
            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["rrid"] != null && Request.QueryString["rrid"] != "")
            {
                LoadAssetTable();
                //Load Attributes
                if (!IsPostBack)
                {
                    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 Added Successfully');<" + "/" + "script>");
                    }



                    oFunction.ConfigureToolButton(btnEmail, "/images/tool_email");
                    oFunction.ConfigureToolButton(btnPrint, "/images/tool_print");
                    oFunction.ConfigureToolButton(btnClose, "/images/tool_close");
                    oFunction.ConfigureToolButton(btnSave, "/images/tool_save");
                    oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                    oFunction.ConfigureToolButton(btnSLA, "/images/tool_sla");

                    btnDenied.Attributes.Add("onclick", "return CloseWindow();");
                    btnPrint.Attributes.Add("onclick", "return PrintWindow();");
                    btnClose.Attributes.Add("onclick", "return ExitWindow();");


                    //btnSave.Attributes.Add("onclick", "return ValidateStatus('" + ddlStatus.ClientID + "','" + txtComments.ClientID + "')" +
                    //   ";");

                    btnStatus.Attributes.Add("onclick", "return ValidateStatus('" + ddlStatus.ClientID + "','" + txtComments.ClientID + "')" +
                                             ";");

                    imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
                }

                LoadRequest();
            }
            else
            {
                panDenied.Visible = true;
            }
        }
示例#8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            Projects      oProject      = new Projects(intProfile, dsn);
            Organizations oOrganization = new Organizations(intProfile, dsn);
            Segment       oSegment      = new Segment(intProfile, dsn);
            Users         oUser         = new Users(intProfile, dsn);
            StatusLevels  oStatusLevel  = new StatusLevels();
            StringBuilder sb            = new StringBuilder(strBody);

            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                int     intProject = Int32.Parse(Request.QueryString["id"]);
                DataSet ds         = oProject.Get(intProject);

                if (ds.Tables[0].Rows.Count > 0)
                {
                    sb.Append("<tr><td nowrap><b>Project Name:</b></td><td>");
                    sb.Append(ds.Tables[0].Rows[0]["name"].ToString());
                    sb.Append("</td></tr>");
                    sb.Append("<tr><td nowrap><b>Project Number:</b></td><td>");
                    sb.Append(ds.Tables[0].Rows[0]["number"].ToString());
                    sb.Append("</td></tr>");
                    sb.Append("<tr><td nowrap><b>Initiative Type:</b></td><td>");
                    sb.Append(ds.Tables[0].Rows[0]["bd"].ToString());
                    sb.Append("</td></tr>");
                    sb.Append("<tr><td nowrap><b>Organization:</b></td><td>");
                    sb.Append(oOrganization.GetName(Int32.Parse(ds.Tables[0].Rows[0]["organization"].ToString())));
                    sb.Append("</td></tr>");
                    sb.Append("<tr><td nowrap><b>Segment:</b></td><td>");
                    sb.Append(oSegment.GetName(Int32.Parse(ds.Tables[0].Rows[0]["segmentid"].ToString())));
                    sb.Append("</td></tr>");
                    sb.Append("<tr><td nowrap><b>Project Lead:</b></td><td>");
                    sb.Append(oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["lead"].ToString())));
                    sb.Append("</td></tr>");
                    sb.Append("<tr><td nowrap><b>Executive Sponsor:</b></td><td>");
                    sb.Append(oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["executive"].ToString())));
                    sb.Append("</td></tr>");
                    sb.Append("<tr><td nowrap><b>Working Sponsor:</b></td><td>");
                    sb.Append(oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["working"].ToString())));
                    sb.Append("</td></tr>");
                    sb.Append("<tr><td nowrap><b>Integration Engineer:</b></td><td>");
                    sb.Append(oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["engineer"].ToString())));
                    sb.Append("</td></tr>");
                    sb.Append("<tr><td nowrap><b>Technical Lead:</b></td><td>");
                    sb.Append(oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["technical"].ToString())));
                    sb.Append("</td></tr>");
                    sb.Append("<tr><td nowrap><b>Status:</b></td><td>");
                    sb.Append(oStatusLevel.HTML(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString())));
                    sb.Append("</td></tr>");
                }
            }

            if (sb.ToString() != "")
            {
                sb.Insert(0, "<table border=\"0\" cellpadding=\"4\" cellspacing=\"3\">");
                sb.Append("</table>");
            }

            strBody = sb.ToString();
        }
示例#9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oProjectRequest  = new ProjectRequest(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oProjectNumber   = new ProjectNumber(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oService         = new Services(intProfile, dsn);
            oDelegate        = new Delegates(intProfile, dsn);
            oStatusLevel     = new StatusLevels();
            oServiceDetail   = new ServiceDetails(intProfile, dsn);
            oLog             = new Log(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 (!IsPostBack)
                {
                    if (Request.QueryString["rrid"] != null && Request.QueryString["rrid"] != "")
                    {
                        lblResourceParent.Text = Request.QueryString["rrid"];
                        int intResourceParent = Int32.Parse(lblResourceParent.Text);
                        ds = oResourceRequest.Get(intResourceParent);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            int      intItem     = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                            int      intService  = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                            int      intRequest  = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                            int      intNumber   = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                            int      intProject  = Int32.Parse(oRequest.Get(intRequest, "projectid"));
                            int      intApp      = oRequestItem.GetItemApplication(intItem);
                            int      intForecast = 0;
                            Forecast oForecast   = new Forecast(intProfile, dsn);
                            DataSet  dsForecast  = oForecast.GetProject(intProject);
                            if (dsForecast.Tables[0].Rows.Count > 0)
                            {
                                intForecast = Int32.Parse(dsForecast.Tables[0].Rows[0]["id"].ToString());
                            }
                            if (intForecast > 0)
                            {
                                btnView.Attributes.Add("oncontextmenu", "return OpenWindow('NEW_WINDOW','" + oPage.GetFullLink(intDesignBuilder) + "?id=" + intForecast.ToString() + "');");
                            }
                            else
                            {
                                btnView.Attributes.Add("oncontextmenu", "alert('There is no design for this project');return false;");
                            }
                            if (ds.Tables[0].Rows[0]["solo"].ToString() == "0")
                            {
                                btnView.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewRequest.ToString() + "&rid=" + intRequest.ToString() + "');");
                                btnView.Text = "Click here to view the project details";
                                lblType.Text = "Project Request";
                            }
                            else
                            {
                                btnView.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewResourceRequest.ToString() + "&rrid=" + intResourceParent.ToString() + "');");
                                if (oApplication.Get(intApp, "tpm") == "1")
                                {
                                    btnView.Text = "Click here to view the project details";
                                }
                                else
                                {
                                    btnView.Text = "Click here to view this request";
                                }
                                lblType.Text = "Service Request";
                            }
                            btnAssignments.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intSearchPage.ToString() + "&pid=" + intProject + "&aid=" + intApp.ToString() + "&sort=userid');");
                            lblItem.Text      = intItem.ToString();
                            lblService.Text   = oService.GetName(intService);
                            lblServiceID.Text = intService.ToString();
                            if (oApplication.Get(intApp, "request_items") == "1")
                            {
                                lblGroup.Text = oApplication.GetName(intApp) + " | " + oRequestItem.GetItemName(intItem);
                            }
                            else
                            {
                                lblGroup.Text = oApplication.GetName(intApp);
                            }
                            int intUser       = Int32.Parse(oRequest.Get(intRequest, "userid"));
                            int intAppManager = oApplication.GetManager(intApp);
                            if (ds.Tables[0].Rows[0]["accepted"].ToString() == "-1" && oApplication.Get(intApp, "tpm") == "1")
                            {
                                if (intUser == intProfile || oDelegate.Get(intUser, intProfile) > 0)
                                {
                                    panRequest.Visible         = true;
                                    panAssignSingle.Visible    = true;
                                    txtHours.Text              = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    lblHoursOverall.Text       = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    txtQuantityOverall.Text    = ds.Tables[0].Rows[0]["devices"].ToString();
                                    txtQuantityOverall.Enabled = false;
                                    txtQuantity.Text           = txtQuantityOverall.Text;
                                    txtQuantity.Enabled        = false;
                                    lblHours.Visible           = true;
                                    lblHours.Text              = txtHours.Text;
                                    lblStatus.Text             = oStatusLevel.HTML(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()));
                                    txtQuantity.Text           = ds.Tables[0].Rows[0]["devices"].ToString();
                                    btnAssign.Enabled          = (txtQuantity.Text != "0");
                                    lblAssignBy.Text           = oUser.GetFullName(intProfile);
                                    strSummary = oResourceRequest.GetBodyOverallFix(intResourceParent, 0, intEnvironment, false);
                                }
                                else
                                {
                                    Response.Write("no rights");
                                    panDenied.Visible = true;
                                }
                                btnSubmit.Attributes.Add("onclick", "return ValidateNumber0('" + txtHours.ClientID + "','Please enter a valid number for the hours allocated') && ValidateHidden('" + hdnManager.ClientID + "','" + txtManager.ClientID + "','Please enter a valid LAN ID') && ProcessButton(this);");
                            }
                            else
                            {
                                if (oUser.IsAdmin(intProfile) || oService.IsManager(intService, intProfile) || (oApplication.IsManager(intApp, intProfile) && oApplication.Get(intApp, "disable_manager") != "1"))
                                {
                                    panRequest.Visible        = true;
                                    panAssignMultiple.Visible = true;
                                    btnSubmit.Enabled         = (ds.Tables[0].Rows[0]["assigned"].ToString() == "");
                                    if (ds.Tables[0].Rows[0]["status"].ToString() == "5")
                                    {
                                        radHold.Checked            = true;
                                        divChoice.Style["display"] = "inline";
                                        divHold.Style["display"]   = "inline";
                                        txtHold.Text = ds.Tables[0].Rows[0]["reason"].ToString();
                                    }
                                    else
                                    {
                                        divChoice.Style["display"] = (ds.Tables[0].Rows[0]["accepted"].ToString() == "0" ? "inline" : "none");
                                        if (Request.QueryString["assign"] != null)
                                        {
                                            divAccept.Style["display"] = "inline";
                                            radAccept.Checked          = true;
                                        }
                                        else
                                        {
                                            divAccept.Style["display"] = (ds.Tables[0].Rows[0]["accepted"].ToString() == "1" ? "inline" : "none");
                                        }
                                    }
                                    panDelete.Visible = (intItem == intImplementorDistributed || intItem == intImplementorMidrange);
                                    btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this request');");
                                    txtHours.Text           = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    lblHoursOverall.Text    = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    txtQuantityOverall.Text = ds.Tables[0].Rows[0]["devices"].ToString();
                                    if (oApplication.Get(intApp, "tpm") == "1")
                                    {
                                        lblHours.Visible           = true;
                                        lblHours.Text              = txtHours.Text;
                                        txtQuantityOverall.Enabled = false;
                                        txtQuantity.Enabled        = false;
                                        btnAssign.Attributes.Add("onclick", "return ValidateDropDown('" + ddlUser.ClientID + "','Please select a technician')" +
                                                                 " && ProcessButton(this)" +
                                                                 ";");
                                    }
                                    else if (oServiceDetail.Gets(intService, 1).Tables[0].Rows.Count > 0)
                                    {
                                        lblHours.Visible = true;
                                        lblHours.Text    = "TBD ";
                                        btnWhy.Visible   = true;
                                        btnAssign.Attributes.Add("onclick", "return ValidateDropDown('" + ddlUser.ClientID + "','Please select a technician')" +
                                                                 " && ValidateNumber0('" + txtQuantity.ClientID + "','Please enter the quantity')" +
                                                                 " && ProcessButton(this)" +
                                                                 ";");
                                    }
                                    else if (oService.Get(intService, "disable_hours") == "1")
                                    {
                                        lblHours.Visible = true;
                                        lblHours.Text    = txtHours.Text;
                                        btnAssign.Attributes.Add("onclick", "return ValidateDropDown('" + ddlUser.ClientID + "','Please select a technician')" +
                                                                 " && ValidateNumber0('" + txtQuantity.ClientID + "','Please enter the quantity')" +
                                                                 " && ProcessButton(this)" +
                                                                 ";");
                                    }
                                    else
                                    {
                                        txtHours.Visible = true;
                                        btnAssign.Attributes.Add("onclick", "return ValidateDropDown('" + ddlUser.ClientID + "','Please select a technician')" +
                                                                 " && ValidateNumber0('" + txtQuantity.ClientID + "','Please enter the quantity')" +
                                                                 " && ValidateNumber0('" + txtHours.ClientID + "','Please enter the hours')" +
                                                                 " && ProcessButton(this)" +
                                                                 ";");
                                    }
                                    btnUpdate.Attributes.Add("onclick", "return ValidateNumber0('" + txtQuantityOverall.ClientID + "') && ProcessButton(this);");
                                    DataSet dsAssigned  = oResourceRequest.GetWorkflowsAssign(intResourceParent);
                                    int     intQuantity = Int32.Parse(ds.Tables[0].Rows[0]["devices"].ToString());
                                    foreach (DataRow drAssigned in dsAssigned.Tables[0].Rows)
                                    {
                                        intQuantity = intQuantity - Int32.Parse(drAssigned["devices"].ToString());
                                    }
                                    txtQuantity.Text    = intQuantity.ToString();
                                    btnAssign.Enabled   = (txtQuantity.Text != "0");
                                    lblStatus.Text      = oStatusLevel.HTML(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()));
                                    lblAssigned.Visible = !(btnSubmit.Enabled);
                                    string  strAssign = "";
                                    DataSet dsManager = oService.GetUser(intService, 1);
                                    foreach (DataRow drManager in dsManager.Tables[0].Rows)
                                    {
                                        if (strAssign != "")
                                        {
                                            strAssign += ", ";
                                        }
                                        strAssign += oUser.GetFullName(Int32.Parse(drManager["userid"].ToString()));
                                    }
                                    lblAssignBy.Text = strAssign;
                                    DataSet   dsReports = oUser.GetManagerReports(intAppManager, intRequest, intService, intNumber);
                                    DataTable dtReports = dsReports.Tables[0].Copy();
                                    dtReports.Clear();
                                    DataSet dsAssignment = oService.GetUser(intService, -100);
                                    foreach (DataRow drAssignment in dsAssignment.Tables[0].Rows)
                                    {
                                        int     intAssignment = Int32.Parse(drAssignment["userid"].ToString());
                                        DataSet dsAssignees   = oUser.GetManagerReports(intAssignment, intRequest, intService, intNumber);
                                        foreach (DataRow drAssignee in dsAssignees.Tables[0].Rows)
                                        {
                                            dtReports.ImportRow(drAssignee);
                                        }
                                    }
                                    if (dtReports.Rows.Count > 0)
                                    {
                                        // Use custom assignment list
                                        // First, remove duplicates
                                        Hashtable hTable        = new Hashtable();
                                        ArrayList duplicateList = new ArrayList();
                                        foreach (DataRow drow in dtReports.Rows)
                                        {
                                            if (hTable.Contains(drow["userid"]))
                                            {
                                                duplicateList.Add(drow);
                                            }
                                            else
                                            {
                                                hTable.Add(drow["userid"], string.Empty);
                                            }
                                        }
                                        foreach (DataRow dRow in duplicateList)
                                        {
                                            dtReports.Rows.Remove(dRow);
                                        }

                                        // Next, sort by username
                                        dtReports.DefaultView.Sort = "username";

                                        // Now add to dataset
                                        dsReports = new DataSet();
                                        dsReports.Tables.Add(dtReports.DefaultView.ToTable());
                                    }
                                    LoadList(dsReports, intApp);
                                    LoadAvailable(dsReports, intApp);
                                    rptAssign.DataSource = dsAssigned;
                                    rptAssign.DataBind();
                                    foreach (RepeaterItem ri in rptAssign.Items)
                                    {
                                        ((LinkButton)ri.FindControl("btnDeleteAssign")).Attributes.Add("onclick", "return confirm('Are you sure you want to delete this assignment?');");
                                    }
                                    lblAssign.Visible = (rptAssign.Items.Count == 0);
                                    strSummary        = oResourceRequest.GetBodyOverallFix(intResourceParent, 0, intEnvironment, false);
                                    btnSubmit.Attributes.Add("onclick", "return ValidateChoice('" + divChoice.ClientID + "','" + radAccept.ClientID + "','" + radReject.ClientID + "','" + radHold.ClientID + "'," + dsAssigned.Tables[0].Rows.Count.ToString() + ") && ProcessButton(this);");
                                }
                                else
                                {
                                    Response.Write("no delegate");
                                    panDenied.Visible = true;
                                }
                            }
                        }
                        else
                        {
                            panDenied.Visible = true;
                        }
                    }
                    else
                    {
                        panDenied.Visible = true;
                    }
                }
            }
            btnClose.Attributes.Add("onclick", "return CloseWindow();");
            lnkAvailable.Attributes.Add("onclick", "return ShowHideAvailable('" + divAvailable.ClientID + "');");
            radAccept.Attributes.Add("onclick", "ShowHideDiv('" + divAccept.ClientID + "','inline');ShowHideDiv('" + divReject.ClientID + "','none');ShowHideDiv('" + divHold.ClientID + "','none');");
            radReject.Attributes.Add("onclick", "ShowHideDiv('" + divReject.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','none');ShowHideDiv('" + divHold.ClientID + "','none');");
            radHold.Attributes.Add("onclick", "ShowHideDiv('" + divHold.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','none');ShowHideDiv('" + divReject.ClientID + "','none');");
            txtManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divManager.ClientID + "','" + lstManager.ClientID + "','" + hdnManager.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstManager.Attributes.Add("ondblclick", "AJAXClickRow();");
            btnWhy.Attributes.Add("onclick", "return ShowHideAvailable('" + divWhy.ClientID + "');");
        }
示例#10
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);
     oProject      = new Projects(intProfile, dsn);
     oOrganization = new Organizations(intProfile, dsn);
     oSegment      = new Segment(intProfile, dsn);
     oFunction     = new Functions(intProfile, dsn, intEnvironment);
     oVariable     = new Variables(intEnvironment);
     //oProjectPending = new ProjectsPending(intProfile, dsn, intEnvironment);
     //oRequest = new Requests(intProfile, dsn);
     oStatusLevel = new StatusLevels();
     oForecast    = new Forecast(intProfile, dsn);
     //oModel = new Models(intProfile, dsn);
     //oType = new Types(intProfile, dsn);
     //oModelsProperties = new ModelsProperties(intProfile, dsn);
     //oPlatform = new Platforms(intProfile, dsn);
     //oConfidence = new Confidence(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);
     }
     lblTitle.Text = oPage.Get(intPage, "title");
     if (Request.QueryString["project"] != null && Request.QueryString["project"] != "")
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "projectsaved", "<script type=\"text/javascript\">alert('Project Information Saved');<" + "/" + "script>");
     }
     if (!IsPostBack)
     {
         if (Request.QueryString["name"] != null)
         {
             string strQuery = oFunction.decryptQueryString(Request.QueryString["name"]);
             txtNameSearch.Text = strQuery;
             CheckResults(strQuery, "", 0, 0);
         }
         else if (Request.QueryString["number"] != null)
         {
             string strQuery = oFunction.decryptQueryString(Request.QueryString["number"]);
             txtNumberSearch.Text = strQuery;
             CheckResults("", strQuery, 0, 0);
         }
         else if (Request.QueryString["lead"] != null)
         {
             int intQuery = Int32.Parse(oFunction.decryptQueryString(Request.QueryString["lead"]));
             txtManagerSearch.Text  = oUser.GetFullName(intQuery) + " (" + oUser.GetName(intQuery) + ")";
             hdnManagerSearch.Value = intQuery.ToString();
             CheckResults("", "", intQuery, 0);
         }
         else if (Request.QueryString["engineer"] != null)
         {
             int intQuery = Int32.Parse(oFunction.decryptQueryString(Request.QueryString["engineer"]));
             txtEngineerSearch.Text  = oUser.GetFullName(intQuery) + " (" + oUser.GetName(intQuery) + ")";
             hdnEngineerSearch.Value = intQuery.ToString();
             CheckResults("", "", 0, intQuery);
         }
         else if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
         {
             LoadLists();
             LoadProject(Int32.Parse(oFunction.decryptQueryString(Request.QueryString["id"])));
         }
         else
         {
             panNone.Visible = true;
         }
         txtWorking.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'250','195','" + divWorking.ClientID + "','" + lstWorking.ClientID + "','" + hdnWorking.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstWorking.Attributes.Add("ondblclick", "AJAXClickRow();");
         txtExecutive.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'250','195','" + divExecutive.ClientID + "','" + lstExecutive.ClientID + "','" + hdnExecutive.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstExecutive.Attributes.Add("ondblclick", "AJAXClickRow();");
         txtManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'250','195','" + divManager.ClientID + "','" + lstManager.ClientID + "','" + hdnManager.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstManager.Attributes.Add("ondblclick", "AJAXClickRow();");
         txtEngineer.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'250','195','" + divEngineer.ClientID + "','" + lstEngineer.ClientID + "','" + hdnEngineer.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstEngineer.Attributes.Add("ondblclick", "AJAXClickRow();");
         txtLead.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'250','195','" + divLead.ClientID + "','" + lstLead.ClientID + "','" + hdnLead.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstLead.Attributes.Add("ondblclick", "AJAXClickRow();");
         txtManagerSearch.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'250','195','" + divManagerSearch.ClientID + "','" + lstManagerSearch.ClientID + "','" + hdnManagerSearch.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstManagerSearch.Attributes.Add("ondblclick", "AJAXClickRow();");
         txtEngineerSearch.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'250','195','" + divEngineerSearch.ClientID + "','" + lstEngineerSearch.ClientID + "','" + hdnEngineerSearch.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
         lstEngineerSearch.Attributes.Add("ondblclick", "AJAXClickRow();");
         ddlPortfolio.Attributes.Add("onchange", "PopulateSegments('" + ddlPortfolio.ClientID + "','" + ddlSegment.ClientID + "');");
         ddlSegment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlSegment.ClientID + "','" + hdnSegment.ClientID + "');");
     }
 }
示例#11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            if (Request.Cookies["profileid"] != null && Request.Cookies["profileid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            }
            oProject         = new Projects(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oOrganization    = new Organizations(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oApplication     = new Applications(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oServiceDetail   = new ServiceDetails(intProfile, dsn);
            oStatusLevel     = new StatusLevels(intProfile, dsn);
            oLog             = new Log(intProfile, dsn);

            if (Request.QueryString["save"] != null)
            {
                panSave.Visible = true;
            }
            if (Request.QueryString["close"] != null)
            {
                Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "close", "<script type=\"text/javascript\">window.close();<" + "/" + "script>");
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    lblResourceWorkflow.Text = Request.QueryString["id"];
                    int intResourceWorkflow = Int32.Parse(lblResourceWorkflow.Text);
                    int intResourceParent   = oResourceRequest.GetWorkflowParent(intResourceWorkflow);

                    string strHeader = intResourceWorkflow.ToString();
                    lblHeader.Text    = "&quot;" + strHeader + "&quot;";
                    Master.Page.Title = "DataPoint | Resource (" + strHeader + ") Administration";
                    lblHeaderSub.Text = "Provides administration of a resource request...";

                    ds = oResourceRequest.Get(intResourceParent);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        int intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                        int intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                        int intApp     = oRequestItem.GetItemApplication(intItem);
                        int intUser    = Int32.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "userid"));
                        int intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                        int intNumber  = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                        int intProject = oRequest.GetProjectNumber(intRequest);
                        if (oService.Get(intService, "disable_hours") != "1")
                        {
                            txtAllocated.Enabled = false;
                            txtAllocated.ToolTip = intService.ToString();
                            panDynamic.Visible   = true;
                        }
                        bool   boolManager = false;
                        double dblUsed     = oResourceRequest.GetWorkflowUsed(intResourceWorkflow);
                        lblUsed.Text      = dblUsed.ToString("F");
                        lblAllocated.Text = oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated");
                        txtAllocated.Text = lblAllocated.Text;
                        txtDevices.Text   = oResourceRequest.GetWorkflow(intResourceWorkflow, "devices");
                        lblDevices.Text   = txtDevices.Text;
                        string strStatus = ds.Tables[0].Rows[0]["status"].ToString();
                        ddlStatus.DataValueField = "StatusValue";
                        ddlStatus.DataTextField  = "StatusDescription";
                        ddlStatus.DataSource     = oStatusLevel.GetStatusList("RRWFSTATUS");
                        ddlStatus.DataBind();
                        ddlStatus.SelectedValue = strStatus;
                        int intAppManager = oApplication.GetManager(intApp);
                        LoadList(intAppManager, intApp);
                        LoadAvailable(intAppManager, intApp, intRequest, intService, intNumber);
                        if (oUser.IsAdmin(intProfile) || oService.IsManager(intService, intProfile) || (oApplication.IsManager(intApp, intProfile) && oApplication.Get(intApp, "disable_manager") != "1") || (oUser.IsManager(intUser, intProfile, true) && oApplication.Get(intApp, "disable_manager") != "1"))
                        {
                            boolManager = true;
                        }
                        try
                        {
                            ddlActivity.SelectedValue = intItem.ToString();
                            lblActivity.Text          = ddlActivity.SelectedItem.Text;
                            hdnUser.Value             = intUser.ToString();
                            txtUser.Text = oUser.GetFullName(intUser) + " (" + oUser.GetName(intUser) + ")";
                            lblUser.Text = txtUser.Text;
                        }
                        catch { }
                        if (boolManager == true)
                        {
                            Master.Page.Title    = "Resource Request #" + intResourceWorkflow.ToString() + " Management View";
                            panView.Visible      = true;
                            panManager.Visible   = true;
                            txtAllocated.Visible = true;
                            txtDevices.Visible   = true;
                            ddlActivity.Visible  = true;
                            panUser.Visible      = true;
                            ddlStatus.Enabled    = true;
                            btnSave.Attributes.Add("onclick", "return ValidateNumber('" + txtAllocated.ClientID + "','Please enter a valid number for the allocated hours')" +
                                                   " && ValidateNumber('" + txtDevices.ClientID + "','Please enter a valid number for the device count')" +
                                                   " && ValidateDropDown('" + ddlActivity.ClientID + "','Please make a selection for the activity type')" +
                                                   " && ValidateHidden0('" + hdnUser.ClientID + "','" + txtUser.ClientID + "','Please select an assigned technician')" +
                                                   " && ProcessControlButton()" +
                                                   ";");
                            btnSaveClose.Attributes.Add("onclick", "return ValidateNumber('" + txtAllocated.ClientID + "','Please enter a valid number for the allocated hours')" +
                                                        " && ValidateNumber('" + txtDevices.ClientID + "','Please enter a valid number for the device count')" +
                                                        " && ValidateDropDown('" + ddlActivity.ClientID + "','Please make a selection for the activity type')" +
                                                        " && ValidateHidden0('" + hdnUser.ClientID + "','" + txtUser.ClientID + "','Please select an assigned technician')" +
                                                        " && ProcessControlButton()" +
                                                        ";");
                        }
                        else
                        {
                            Master.Page.Title    = "Resource Request #" + intResourceWorkflow.ToString() + " Technician View";
                            panView.Visible      = true;
                            lblAllocated.Visible = true;
                            lblDevices.Visible   = true;
                            lblActivity.Visible  = true;
                            lblUser.Visible      = true;
                        }
                    }
                    else
                    {
                        panDenied.Visible = true;
                    }
                }
                else
                {
                    panDenied.Visible = true;
                }

                txtUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divUser.ClientID + "','" + lstUser.ClientID + "','" + hdnUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
                lstUser.Attributes.Add("ondblclick", "AJAXClickRow();");
                lnkAvailable.Attributes.Add("onclick", "return ShowHideAvailable('" + divAvailable.ClientID + "');");
                btnFinish.Attributes.Add("onclick", "return CloseWindow();");
                btnClose.Attributes.Add("onclick", "return CloseWindow();");
                btnDenied.Attributes.Add("onclick", "return CloseWindow();");
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
            {
                StringBuilder sb = new StringBuilder(strQuestions);
                oForecast         = new Forecast(intProfile, dsn);
                oUser             = new Users(intProfile, dsn);
                oProject          = new Projects(intProfile, dsn);
                oProjectPending   = new ProjectsPending(intProfile, dsn, intEnvironment);
                oRequest          = new Requests(intProfile, dsn);
                oOrganization     = new Organizations(intProfile, dsn);
                oStatusLevel      = new StatusLevels();
                oPlatform         = new Platforms(intProfile, dsn);
                oModel            = new Models(intProfile, dsn);
                oModelsProperties = new ModelsProperties(intProfile, dsn);
                int intForecast = Int32.Parse(Request.QueryString["id"]);
                if (!IsPostBack)
                {
                    Document doc = new Document();
                    iTextSharp.text.Table oTable = new iTextSharp.text.Table(2);
                    oTable.BorderWidth = 0;
                    oTable.BorderColor = new iTextSharp.text.Color(255, 255, 255);
                    oTable.Padding     = 2;
                    oTable.Width       = 100;
                    iTextSharp.text.Font oFontHeader = new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 10, 1);
                    iTextSharp.text.Font oFontBold   = new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 8, 1);
                    iTextSharp.text.Font oFont       = new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 8, 0);
                    if (Request.QueryString["export"] != null)
                    {
                        PdfWriter.GetInstance(doc, Response.OutputStream);
                        string       strHeader = "ClearView Design Summary";
                        HeaderFooter header    = new HeaderFooter(new Phrase(strHeader, new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 6)), false);
                        header.Border    = iTextSharp.text.Rectangle.NO_BORDER;
                        header.Alignment = 2;
                        doc.Header       = header;
                        string       strFooter = DateTime.Now.ToLongDateString() + " " + DateTime.Now.ToLongTimeString();
                        HeaderFooter footer    = new HeaderFooter(new Phrase(strFooter, new iTextSharp.text.Font(iTextSharp.text.Font.HELVETICA, 6)), false);
                        footer.Border    = iTextSharp.text.Rectangle.NO_BORDER;
                        footer.Alignment = 2;
                        doc.Footer       = footer;
                        doc.Open();
                        //iTextSharp.text.Image gif = iTextSharp.text.Image.GetInstance(Request.MapPath("~/images/nc_logo.gif"));
                        //gif.Alignment = iTextSharp.text.Image.RIGHT_ALIGN;
                        //gif.ScalePercent(50f); // change it's size
                        //doc.Add(gif);
                        Cell cell = new Cell(new Phrase("General Information", oFontHeader));
                        cell.Colspan         = 2;
                        cell.BackgroundColor = new iTextSharp.text.Color(204, 204, 204);
                        oTable.AddCell(cell);
                    }
                    DataSet ds         = oForecast.Get(intForecast);
                    int     intRequest = 0;
                    sb.Append("<table width=\"100%\" cellpadding=\"4\" cellspacing=\"3\" border=\"0\">");
                    sb.Append("<tr><td colspan=\"2\" class=\"header\">General Information</td></tr>");
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        oTable.AddCell(new Cell(new Phrase("Requestor:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString())), oFont)));
                        sb.Append("<tr><td nowrap>Requestor:</td><td width=\"100%\">");
                        sb.Append(oUser.GetFullName(Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString())));
                        sb.Append("</td></tr>");
                        oTable.AddCell(new Cell(new Phrase("Submission Date:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToLongDateString(), oFont)));
                        sb.Append("<tr><td nowrap>Submission Date:</td><td width=\"100%\">");
                        sb.Append(DateTime.Parse(ds.Tables[0].Rows[0]["created"].ToString()).ToLongDateString());
                        sb.Append("</td></tr>");
                        intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                    }
                    int intManager  = 0;
                    int intEngineer = 0;
                    int intLead     = 0;
                    int intProject  = oRequest.GetProjectNumber(intRequest);
                    if (intProject > 0)
                    {
                        DataSet dsProject = oProject.Get(intProject);
                        if (dsProject.Tables[0].Rows.Count > 0)
                        {
                            oTable.AddCell(new Cell(new Phrase("Project Name:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsProject.Tables[0].Rows[0]["name"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Initiative Type:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsProject.Tables[0].Rows[0]["bd"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Organization:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(oOrganization.GetName(Int32.Parse(dsProject.Tables[0].Rows[0]["organization"].ToString())), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Project Number:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsProject.Tables[0].Rows[0]["number"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Project Status:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(oStatusLevel.Name(Int32.Parse(dsProject.Tables[0].Rows[0]["status"].ToString())), oFont)));
                            sb.Append("<tr><td nowrap>Project Name:</td><td width=\"100%\">");
                            sb.Append(dsProject.Tables[0].Rows[0]["name"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Initiative Type:</td><td width=\"100%\">");
                            sb.Append(dsProject.Tables[0].Rows[0]["bd"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Organization:</td><td width=\"100%\">");
                            sb.Append(oOrganization.GetName(Int32.Parse(dsProject.Tables[0].Rows[0]["organization"].ToString())));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Project Number:</td><td width=\"100%\">");
                            sb.Append(dsProject.Tables[0].Rows[0]["number"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Project Status:</td><td width=\"100%\">");
                            sb.Append(oStatusLevel.HTML(Int32.Parse(dsProject.Tables[0].Rows[0]["status"].ToString())));
                            sb.Append("</td></tr>");
                            intManager  = Int32.Parse(dsProject.Tables[0].Rows[0]["lead"].ToString());
                            intEngineer = Int32.Parse(dsProject.Tables[0].Rows[0]["engineer"].ToString());
                            intLead     = Int32.Parse(dsProject.Tables[0].Rows[0]["technical"].ToString());
                        }
                    }
                    else
                    {
                        DataSet dsPending = oProjectPending.GetRequest(intRequest);
                        if (dsPending.Tables[0].Rows.Count > 0)
                        {
                            oTable.AddCell(new Cell(new Phrase("Project Name:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsPending.Tables[0].Rows[0]["name"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Initiative Type:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsPending.Tables[0].Rows[0]["bd"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Organization:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(oOrganization.GetName(Int32.Parse(dsPending.Tables[0].Rows[0]["organization"].ToString())), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Project Number:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase(dsPending.Tables[0].Rows[0]["number"].ToString(), oFont)));
                            oTable.AddCell(new Cell(new Phrase("Project Status:", oFontBold)));
                            oTable.AddCell(new Cell(new Phrase("PENDING", oFont)));
                            sb.Append("<tr><td nowrap>Project Name:</td><td width=\"100%\">");
                            sb.Append(dsPending.Tables[0].Rows[0]["name"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Initiative Type:</td><td width=\"100%\">");
                            sb.Append(dsPending.Tables[0].Rows[0]["bd"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Organization:</td><td width=\"100%\">");
                            sb.Append(oOrganization.GetName(Int32.Parse(dsPending.Tables[0].Rows[0]["organization"].ToString())));
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Project Number:</td><td width=\"100%\">");
                            sb.Append(dsPending.Tables[0].Rows[0]["number"].ToString());
                            sb.Append("</td></tr>");
                            sb.Append("<tr><td nowrap>Project Status:</td><td width=\"100%\" class=\"pending\">PENDING</td></tr>");
                            intManager  = Int32.Parse(dsPending.Tables[0].Rows[0]["lead"].ToString());
                            intEngineer = Int32.Parse(dsPending.Tables[0].Rows[0]["engineer"].ToString());
                            intLead     = Int32.Parse(dsPending.Tables[0].Rows[0]["technical"].ToString());
                        }
                    }
                    if (intManager > 0)
                    {
                        sb.Append("<tr><td nowrap>Project Manager:</td><td width=\"100%\">");
                        sb.Append(oUser.GetFullName(intManager));
                        sb.Append("</td></tr>");
                    }
                    else
                    {
                        sb.Append("<tr><td nowrap>Project Manager:</td><td width=\"100%\"></td></tr>");
                    }
                    if (intEngineer > 0)
                    {
                        sb.Append("<tr><td nowrap>Integration Engineer:</td><td width=\"100%\">");
                        sb.Append(oUser.GetFullName(intEngineer));
                        sb.Append("</td></tr>");
                    }
                    else
                    {
                        sb.Append("<tr><td nowrap>Integration Engineer:</td><td width=\"100%\"></td></tr>");
                    }
                    if (intLead > 0)
                    {
                        sb.Append("<tr><td nowrap>Technical Lead:</td><td width=\"100%\">");
                        sb.Append(oUser.GetFullName(intLead));
                        sb.Append("</td></tr>");
                    }
                    else
                    {
                        sb.Append("<tr><td nowrap>Technical Lead:</td><td width=\"100%\"></td></tr>");
                    }

                    oTable.AddCell(new Cell(new Phrase("Project Manager:", oFontBold)));
                    oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(intManager), oFont)));
                    oTable.AddCell(new Cell(new Phrase("Integration Engineer:", oFontBold)));
                    oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(intEngineer), oFont)));
                    oTable.AddCell(new Cell(new Phrase("Technical Lead:", oFontBold)));
                    oTable.AddCell(new Cell(new Phrase(oUser.GetFullName(intLead), oFont)));
                    oTable.AddCell(new Cell(new Phrase(" ", oFontBold)));
                    oTable.AddCell(new Cell(new Phrase(" ", oFont)));
                    Cell cell2 = new Cell(new Phrase("Line Items", oFontHeader));
                    cell2.Colspan         = 2;
                    cell2.BackgroundColor = new iTextSharp.text.Color(204, 204, 204);
                    oTable.AddCell(cell2);
                    sb.Append("<tr><td colspan=\"2\"><hr size=\"1\" noshade /></td></tr>");
                    sb.Append("<tr><td colspan=\"2\" class=\"header\">Line Items</td></tr>");
                    sb.Append("<tr><td colspan=\"2\">");
                    ds = oForecast.GetAnswers(intForecast);
                    bool boolChange = false;
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        int    intID          = Int32.Parse(dr["id"].ToString());
                        int    intPlatform    = Int32.Parse(dr["platformid"].ToString());
                        int    intClass       = Int32.Parse(dr["classid"].ToString());
                        int    intEnvir       = Int32.Parse(dr["environmentid"].ToString());
                        double dblQuantity    = double.Parse(dr["quantity"].ToString()) + double.Parse(dr["recovery_number"].ToString());
                        int    intModel       = 0;
                        int    intServerModel = oForecast.GetModelAsset(intID);
                        if (intServerModel == 0)
                        {
                            intServerModel = oForecast.GetModel(intID);
                        }
                        if (intServerModel == 0)
                        {
                            // Get the model selected in the equipment dropdown (if not server)
                            intModel = Int32.Parse(dr["modelid"].ToString());
                        }
                        double dblAmp       = 0.00;
                        double dblReplicate = 0.00;
                        string strModel     = "";
                        if (intServerModel > 0)
                        {
                            dblAmp = (double.Parse(oModelsProperties.Get(intServerModel, "amp")) * dblQuantity);
                            double.TryParse(oModelsProperties.Get(intServerModel, "replicate_times"), out dblReplicate);
                            if (intModel == 0)
                            {
                                intModel = Int32.Parse(oModelsProperties.Get(intServerModel, "modelid"));
                            }
                            strModel = oModelsProperties.Get(intServerModel, "name");
                        }
                        else if (intModel > 0)
                        {
                            strModel = oModel.Get(intModel, "name");
                        }
                        else
                        {
                            DataSet dsVendor = oForecast.GetAnswer(intID);
                            if (dsVendor.Tables[0].Rows.Count > 0 && dsVendor.Tables[0].Rows[0]["modelname"].ToString() != "")
                            {
                                dblAmp   = (double.Parse(dsVendor.Tables[0].Rows[0]["amp"].ToString()) * dblQuantity);
                                strModel = dsVendor.Tables[0].Rows[0]["modelname"].ToString();
                            }
                        }
                        if (intModel == 0)
                        {
                            strModel = "Solution Unavailable";
                        }
                        // STORAGE
                        DataSet dsStorage  = oForecast.GetStorage(intID);
                        double  dblStorage = 0.00;
                        if (dsStorage.Tables[0].Rows.Count > 0)
                        {
                            double dblHigh     = double.Parse(dsStorage.Tables[0].Rows[0]["high_total"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["high_qa"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["high_test"].ToString()) + (double.Parse(dsStorage.Tables[0].Rows[0]["high_replicated"].ToString()) * dblReplicate) + double.Parse(dsStorage.Tables[0].Rows[0]["high_ha"].ToString());
                            double dblStandard = double.Parse(dsStorage.Tables[0].Rows[0]["standard_total"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["standard_qa"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["standard_test"].ToString()) + (double.Parse(dsStorage.Tables[0].Rows[0]["standard_replicated"].ToString()) * dblReplicate) + double.Parse(dsStorage.Tables[0].Rows[0]["standard_ha"].ToString());
                            double dblLow      = double.Parse(dsStorage.Tables[0].Rows[0]["low_total"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["low_qa"].ToString()) + double.Parse(dsStorage.Tables[0].Rows[0]["low_test"].ToString()) + (double.Parse(dsStorage.Tables[0].Rows[0]["low_replicated"].ToString()) * dblReplicate) + double.Parse(dsStorage.Tables[0].Rows[0]["low_ha"].ToString());
                            dblStorage = dblHigh + dblStandard + dblLow;
                        }
                        sb.Append("<table width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"background-color:");
                        sb.Append(boolChange ? "#FFFFFF" : "#F6F6F6");
                        sb.Append("\">");
                        sb.Append("<tr><td>");
                        sb.Append("<table width=\"100%\" cellpadding=\"5\" cellspacing=\"2\" border=\"0\">");
                        sb.Append("<tr><td valign=\"top\" nowrap>Nickname:</td><td>");
                        sb.Append(dr["name"].ToString());
                        sb.Append("</td></tr>");
                        sb.Append("<tr><td valign=\"top\" nowrap>Platform:</td><td>");
                        sb.Append(oPlatform.GetName(intPlatform));
                        sb.Append("</td></tr>");
                        oTable.AddCell(new Cell(new Phrase("Nickname:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dr["name"].ToString(), oFont)));
                        oTable.AddCell(new Cell(new Phrase("Platform:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(oPlatform.GetName(intPlatform), oFont)));
                        oTable.AddCell(new Cell(new Phrase("Model:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(strModel, oFont)));
                        oTable.AddCell(new Cell(new Phrase("Commitment Date:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase((dr["implementation"].ToString() == "" ? "" : DateTime.Parse(dr["implementation"].ToString()).ToShortDateString()), oFont)));
                        oTable.AddCell(new Cell(new Phrase("Quantity:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dblQuantity.ToString(), oFont)));
                        string strPDF = oModel.Get(intModel, "pdf");
                        sb.Append("<tr><td valign=\"top\" nowrap>Model:</td><td width=\"100%\">");
                        sb.Append(strPDF == "" ? strModel : "<a href=\"javascript:void(0);\" onclick=\"OpenNewWindowMAX('" + strPDF.Replace("\\", "\\\\") + "');\">" + strModel + "</a>");
                        sb.Append("</td></tr>");
                        sb.Append("<tr><td valign=\"top\" nowrap>Commitment Date:</td><td width=\"100%\">");
                        sb.Append(dr["implementation"].ToString() == "" ? "" : DateTime.Parse(dr["implementation"].ToString()).ToShortDateString());
                        sb.Append("</td></tr>");
                        sb.Append("<tr><td valign=\"top\" nowrap>Quantity:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_quantity.aspx?id=");
                        sb.Append(intID.ToString());
                        sb.Append("',275,200);\">");
                        sb.Append(dblQuantity.ToString());
                        sb.Append("</a></td></tr>");
                        double  dblA = 0.00;
                        DataSet dsA  = oForecast.GetAcquisitions(intModel, 1);
                        foreach (DataRow drA in dsA.Tables[0].Rows)
                        {
                            dblA += double.Parse(drA["cost"].ToString());
                        }
                        sb.Append("<tr><td valign=\"top\" nowrap>Acquisition Costs:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_acquisition.aspx?id=");
                        sb.Append(intID.ToString());
                        sb.Append("',400,300);\">$");
                        sb.Append(dblA.ToString("N"));
                        sb.Append("</a></td></tr>");
                        oTable.AddCell(new Cell(new Phrase("Acquisition Costs:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dblA.ToString("N"), oFont)));
                        double  dblO = 0.00;
                        DataSet dsO  = oForecast.GetOperations(intModel, 1);
                        foreach (DataRow drO in dsO.Tables[0].Rows)
                        {
                            dblO += double.Parse(drO["cost"].ToString());
                        }
                        oTable.AddCell(new Cell(new Phrase("Operational Costs:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dblO.ToString("N"), oFont)));
                        oTable.AddCell(new Cell(new Phrase("Storage:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dblStorage.ToString("N") + " GB", oFont)));
                        oTable.AddCell(new Cell(new Phrase("AMPs:", oFontBold)));
                        oTable.AddCell(new Cell(new Phrase(dblAmp.ToString("N") + " AMPs", oFont)));
                        sb.Append("<tr><td valign=\"top\" nowrap>Operational Costs:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_operational.aspx?id=");
                        sb.Append(intID.ToString());
                        sb.Append("',400,300);\">$");
                        sb.Append(dblO.ToString("N"));
                        sb.Append("</a></td></tr>");
                        sb.Append("<tr><td valign=\"top\" nowrap>Storage:</td><td width=\"100%\"><a href=\"javascript:void(0);\" onclick=\"OpenNewWindow('/frame/forecast/forecast_print_storage.aspx?id=");
                        sb.Append(intID.ToString());
                        sb.Append("',650,200);\">");
                        sb.Append(dblStorage.ToString("N"));
                        sb.Append(" GB</a></td></tr>");
                        sb.Append("<tr><td valign=\"top\" nowrap>AMPs:</td><td width=\"100%\">");
                        sb.Append(dblAmp.ToString("N"));
                        sb.Append("</td></tr>");
                        if (Request.QueryString["checked"] != null)
                        {
                            sb.Append("<tr><td valign=\"top\" colspan=\"2\"><b>Questions & Responses</b></td></tr>");
                            DataSet dsQuestions = oForecast.GetQuestionPlatform(intPlatform, intClass, intEnvir);
                            foreach (DataRow drQuestion in dsQuestions.Tables[0].Rows)
                            {
                                string  strResponse    = "";
                                string  strResponsePDF = "";
                                int     intQuestion    = Int32.Parse(drQuestion["id"].ToString());
                                DataSet dsAnswers      = oForecast.GetAnswerPlatform(intID, intQuestion);
                                foreach (DataRow drAnswer in dsAnswers.Tables[0].Rows)
                                {
                                    strResponse += "<tr><td valign=\"top\"></td><td> " + oForecast.GetResponse(Int32.Parse(drAnswer["responseid"].ToString()), "response") + "</td></tr>";
                                    if (strResponsePDF != "")
                                    {
                                        strResponsePDF += ", ";
                                    }
                                    strResponsePDF += oForecast.GetResponse(Int32.Parse(drAnswer["responseid"].ToString()), "response");
                                }
                                if (strResponse != "")
                                {
                                    sb.Append("<tr><td valign=\"top\" colspan=\"2\"><table cellpadding=\"1\" cellspacing=\"1\" border=\"0\">");
                                    sb.Append("<tr><td valign=\"top\"><img src=\"/images/help.gif\" align=\"absmiddle\" border=\"0\"/></td><td>");
                                    sb.Append(drQuestion["question"].ToString());
                                    sb.Append("</td></tr>");
                                    Cell oCellQ = new Cell(new Phrase(drQuestion["question"].ToString(), oFontBold));
                                    oCellQ.Colspan = 2;
                                    oTable.AddCell(oCellQ);
                                    Cell oCellA = new Cell(new Phrase(strResponsePDF, oFont));
                                    oCellA.Colspan = 2;
                                    oTable.AddCell(oCellA);
                                    sb.Append(strResponse);
                                    sb.Append("</table></td></tr>");
                                }
                            }
                        }
                        sb.Append("</table></td></tr>");
                        Cell oCellD = new Cell(new Phrase("", oFont));
                        oCellD.Colspan         = 2;
                        oCellD.BackgroundColor = new iTextSharp.text.Color(100, 100, 100);
                        oTable.AddCell(oCellD);
                        sb.Append("<tr height=\"1\"><td colspan=\"2\" style=\"border-bottom:dashed 1px #CCCCCC\"><img src=\"/images/spacer.gif\" border=\"0\" width=\"1\" height=\"1\" /></td></tr>");
                        sb.Append("</table>");
                        boolChange = !boolChange;
                    }
                    sb.Append("</td></tr>");
                    chkQuestions.Checked = (Request.QueryString["checked"] != null);
                    chkQuestions.Attributes.Add("onclick", "WaitDDL('" + divWait.ClientID + "');");
                    if (Request.QueryString["export"] != null)
                    {
                        doc.Add(oTable);
                        doc.Close();
                        Response.ContentType = "application/pdf";
                        Response.AddHeader("Content-Disposition", "attachment; filename=export.pdf");
                        Response.End();
                        Response.Flush();
                    }
                }

                strQuestions = sb.ToString();
            }
        }
示例#13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oProjectRequest  = new ProjectRequest(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oProject         = new Projects(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oApplication     = new Applications(intProfile, dsn);
            oProjectNumber   = new ProjectNumber(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oRequestField    = new RequestFields(intProfile, dsn);
            oDocument        = new Documents(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oStatus          = new StatusLevels();
            oService         = new Services(intProfile, dsn);
            oDelegate        = new Delegates(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["pid"] != null && Request.QueryString["pid"] != "")
            {
                int intProject = Int32.Parse(Request.QueryString["pid"]);
                lblProject.Text = intProject.ToString();
                ds = oProject.GetCoordinator(intProject, 0);
                int  intCoordinator  = 0;
                int  intRequest      = 0;
                int  intResource     = 0;
                bool boolCoordinator = false;
                bool boolTPM         = false;
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    if ((Int32.Parse(dr["userid"].ToString()) == intProfile || oDelegate.Get(Int32.Parse(dr["userid"].ToString()), intProfile) > 0) && (Request.QueryString["search"] == null))
                    {
                        if (dr["tpm"].ToString() == "1")
                        {
                            boolTPM = true;
                        }
                        else
                        {
                            boolCoordinator = true;
                        }
                    }
                }
                if (ds.Tables[0].Rows.Count > 0)
                {
                    //panProject.Visible = true;
                    intRequest          = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                    intResource         = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                    intCoordinator      = Int32.Parse(ds.Tables[0].Rows[0]["userid"].ToString());
                    lblCoordinator.Text = oUser.GetFullName(intCoordinator);
                    lblPhone.Text       = (oUser.Get(intCoordinator, "phone") == "" ? "N / A" : oUser.Get(intCoordinator, "phone"));
                    string strEmail = oUser.GetEmail(oUser.GetName(intCoordinator), intEnvironment);
                    lblEmail.Text = (strEmail == "" ? "N / A" : "<a href=\"mailto:" + strEmail + "\" target=\"_blank\">" + strEmail + "</a>");
                    string strPager = oUser.Get(intCoordinator, "pager");
                    lblMobileDevice.Text = (strPager == "" || strPager == "0" ? "N / A" : strPager);
                    string strAt = oUser.Get(intCoordinator, "atid");
                    if (strAt != "0" && strAt != "")
                    {
                        Users_At oUserAt = new Users_At(intProfile, dsn);
                        strPager           += "@" + oUserAt.GetName(Int32.Parse(strAt));
                        lblMobileEmail.Text = "<a href=\"mailto:" + strPager + "\" target=\"_blank\">" + strPager + "</a>";
                    }
                    else
                    {
                        lblMobileEmail.Text = "N / A";
                    }
                }
                lblRequest.Text = intRequest.ToString();
                if (Request.QueryString["comm"] != null && Request.QueryString["comm"] != "")
                {
                    trCommunication.Visible = true;
                }
                if (boolTPM == true)
                {
                    //                if (CheckConfigured(intProject, intRequest, intResource) == true)
                    //                {
                    panControl.Visible = true;
                    Control oControl = (Control)LoadControl(strTPMWM);
                    phControl.Controls.Add(oControl);
                    LoadProject(intProject);
                    //                }
                    //                else
                    //                    panConfigure.Visible = true;
                }
                else if (boolCoordinator == true)
                {
                    panControl.Visible = true;
                    Control oControl = (Control)LoadControl(strPCWM);
                    phControl.Controls.Add(oControl);
                    LoadProject(intProject);
                }
                else if (oApplication.GetName(intApplication).Contains("IDC") == true || oApplication.GetName(intApplication).Contains("Integration Engineer") == true)
                {
                    panControl.Visible = true;
                    Control oControl = (Control)LoadControl("/controls/wm/wm_ie.ascx");
                    phControl.Controls.Add(oControl);
                    LoadProject(intProject);
                }
                else
                {
                    panWorkload.Visible = true;
                    ds = oResourceRequest.GetWorkflowProjectAll(intProject);
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        ds = oProjectRequest.GetProject(intProject);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            btnViewPR.Text = "View Original Project Request";
                            btnViewPR.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewRequest.ToString() + "&rid=" + intRequest.ToString() + "');");
                        }
                        else
                        {
                            //if (intResource > 0)
                            //{
                            //    btnViewPR.Text = "View Original Request Details";
                            //    btnViewPR.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewResourceRequest.ToString() + "&rrid=" + intResource.ToString() + "');");
                            //}
                            //else
                            btnViewPR.Visible = false;
                        }
                        // Documents
                        btnDocuments.Attributes.Add("onclick", "return OpenWindow('DOCUMENTS_SECURE','?pid=" + intProject.ToString() + "');");
                        chkMyDescription.Checked = (Request.QueryString["mydoc"] != null);
                        lblMyDocuments.Text      = oDocument.GetDocuments_Mine(intProject, intProfile, oVariable.DocumentsFolder(), -1, (Request.QueryString["mydoc"] != null));
                        // GetDocuments(string _physical, int _projectid, int _requestid, int _userid, int _security, bool _show_description, bool _mine)
                        //lblMyDocuments.Text = oDocument.GetDocuments(Request.PhysicalApplicationPath, intProject, 0, intProfile, -1, (Request.QueryString["mydoc"] != null), true);
                        chkDescription.Checked = (Request.QueryString["doc"] != null);
                        lblDocuments.Text      = oDocument.GetDocuments_Project(intProject, intProfile, oVariable.DocumentsFolder(), 1, (Request.QueryString["doc"] != null));
                        // GetDocuments(string _physical, int _projectid, int _requestid, int _userid, int _security, bool _show_description, bool _mine)
                        //lblDocuments.Text = oDocument.GetDocuments(Request.PhysicalApplicationPath, intProject, 0, intProfile, 1, (Request.QueryString["doc"] != null), false);

                        /*
                         * ds = oResourceRequest.GetWorkflowProject(intProject);
                         * int intOldUser = 0;
                         * foreach (DataRow dr in ds.Tables[0].Rows)
                         * {
                         *  if (intOldUser == Int32.Parse(dr["userid"].ToString()))
                         *      dr.Delete();
                         *  else
                         *      intOldUser = Int32.Parse(dr["userid"].ToString());
                         * }
                         * ddlResource.DataValueField = "userid";
                         * ddlResource.DataTextField = "userid";
                         * ddlResource.DataSource = ds;
                         * ddlResource.DataBind();
                         * foreach (ListItem oItem in ddlResource.Items)
                         *  oItem.Text = oUser.GetFullName(Int32.Parse(oItem.Value));
                         * ddlResource.Items.Insert(0, new ListItem("-- SELECT --", "0"));
                         * // Load Involvement
                         * DataSet dsInvolvement = oResourceRequest.GetWorkflowProject(intProject);
                         * int intOldItem = 0;
                         * intOldUser = 0;
                         * foreach (DataRow dr in dsInvolvement.Tables[0].Rows)
                         * {
                         *  if (intImplementorDistributed == Int32.Parse(dr["itemid"].ToString()))
                         *      dr.Delete();
                         *  else if (intImplementorMidrange == Int32.Parse(dr["itemid"].ToString()))
                         *      dr.Delete();
                         *  else if (intOldItem == Int32.Parse(dr["itemid"].ToString()) && intOldUser == Int32.Parse(dr["userid"].ToString()))
                         *      dr.Delete();
                         *  else
                         *  {
                         *      intOldItem = Int32.Parse(dr["itemid"].ToString());
                         *      intOldUser = Int32.Parse(dr["userid"].ToString());
                         *  }
                         * }
                         * rptInvolvement.DataSource = dsInvolvement;
                         * rptInvolvement.DataBind();
                         * lblNoInvolvement.Visible = (rptInvolvement.Items.Count == 0);
                         * foreach (RepeaterItem ri in rptInvolvement.Items)
                         * {
                         *  Label _id = (Label)ri.FindControl("lblId");
                         *  Label _user = (Label)ri.FindControl("lblUser");
                         *  Label _status = (Label)ri.FindControl("lblStatus");
                         *  int intStatus = Int32.Parse(_status.Text);
                         *  int intUser = Int32.Parse(_user.Text);
                         *  _user.Text = oUser.GetFullName(intUser);
                         *  Label _item = (Label)ri.FindControl("lblItem");
                         *  int intItem = Int32.Parse(_item.Text);
                         *  Label _allocated = (Label)ri.FindControl("lblAllocated");
                         *  Label _used = (Label)ri.FindControl("lblUsed");
                         *  double dblAllocated = oResourceRequest.GetAllocated(intProject, intUser, intItem);
                         *  double dblUsed = oResourceRequest.GetUsed(intProject, intUser, intItem);
                         *  Label _percent = (Label)ri.FindControl("lblPercent");
                         *  _allocated.Text = dblAllocated.ToString();
                         *  _used.Text = dblUsed.ToString();
                         *  if (dblAllocated > 0)
                         *  {
                         *      dblUsed = dblUsed / dblAllocated;
                         *      _percent.Text = dblUsed.ToString("P");
                         *  }
                         *  else
                         *      _percent.Text = dblAllocated.ToString("P");
                         *  if (intItem == 0)
                         *      _item.Text = "Project Coordinator";
                         *  else
                         *  {
                         *      if (intItem == -1)
                         *          _item.Text = "Design Implementor";
                         *      else
                         *      {
                         *          int intApp = oRequestItem.GetItemApplication(intItem);
                         *          _item.Text = oApplication.GetName(intApp);
                         *      }
                         *  }
                         *  _status.Text = oStatus.Name(intStatus);
                         * }
                         */
                        // MY Involvement
                        DataSet dsMine = oResourceRequest.GetWorkflowProject(intProject);
                        //Check if new request
                        DataColumn oColumn;
                        oColumn            = new DataColumn();
                        oColumn.DataType   = System.Type.GetType("System.String");
                        oColumn.ColumnName = "new";
                        dsMine.Tables[0].Columns.Add(oColumn);
                        foreach (DataRow dr in dsMine.Tables[0].Rows)
                        {
                            if (intImplementorDistributed == Int32.Parse(dr["itemid"].ToString()))
                            {
                                dr.Delete();
                            }
                            else if (intImplementorMidrange == Int32.Parse(dr["itemid"].ToString()))
                            {
                                dr.Delete();
                            }
                            else if (DateTime.Parse(dr["created"].ToString()) <= DateTime.Parse(dr["modified"].ToString()))
                            {
                                dr["new"] = "1";
                            }
                            //else if (intProfile != Int32.Parse(dr["userid"].ToString()) && oDelegate.Get(Int32.Parse(dr["userid"].ToString()), intProfile) <= 0)
                            //    dr.Delete();
                        }
                        Functions oFunction = new Functions(0, dsn, intEnvironment);
                        rptMine.DataSource = dsMine;
                        rptMine.DataBind();
                        lblNoMine.Visible = (rptMine.Items.Count == 0);
                        foreach (RepeaterItem ri in rptMine.Items)
                        {
                            Label _id         = (Label)ri.FindControl("lblId");
                            Label _user       = (Label)ri.FindControl("lblUser");
                            Label _status     = (Label)ri.FindControl("lblStatus");
                            Label _color      = (Label)ri.FindControl("lblColor");
                            Label _service    = (Label)ri.FindControl("lblServiceId");
                            int   _serviceid  = Int32.Parse(_service.Text);
                            Label _name       = (Label)ri.FindControl("lblName");
                            Image imgDelegate = (Image)ri.FindControl("imgDelegate");
                            int   intStatus   = Int32.Parse(_status.Text);
                            int   intUser     = Int32.Parse(_user.Text);
                            if ((intStatus < 1 || intStatus > 2) && intStatus != 5)
                            {
                                ri.Visible = false;
                            }
                            else if (intUser != intProfile)
                            {
                                if (oDelegate.Get(intUser, intProfile) <= 0)
                                {
                                    ri.Visible = false;
                                }
                                else
                                {
                                    imgDelegate.Visible = true;
                                }
                            }
                            if (ri.Visible == true)
                            {
                                string strColor = _color.Text;
                                int    intGreen = 0;
                                Int32.TryParse(strColor.Substring(0, strColor.IndexOf("_")), out intGreen);
                                strColor = strColor.Substring(strColor.IndexOf("_") + 1);
                                int intYellow = 0;
                                Int32.TryParse(strColor.Substring(0, strColor.IndexOf("_")), out intYellow);
                                strColor = strColor.Substring(strColor.IndexOf("_") + 1);
                                int intRed = 0;
                                Int32.TryParse(strColor, out intRed);
                                strColor = "<table cellpadding=\"0\" cellspacing=\"2\" border=\"0\">";
                                if (intRed > 0)
                                {
                                    strColor += "<tr><td>" + oFunction.GetBox("FF0000", 15, 8) + "</td>" + (intRed > 1 ? "<td> (" + intRed.ToString() + ")</td>" : "") + "</tr>";
                                }
                                if (intYellow > 0)
                                {
                                    strColor += "<tr><td>" + oFunction.GetBox("FFFF00", 15, 8) + "</td>" + (intYellow > 1 ? "<td> (" + intYellow.ToString() + ")</td>" : "") + "</tr>";
                                }
                                if (intGreen > 0)
                                {
                                    strColor += "<tr><td>" + oFunction.GetBox("00FF00", 15, 8) + "</td>" + (intGreen > 1 ? "<td> (" + intGreen.ToString() + ")</td>" : "") + "</tr>";
                                }
                                strColor   += "</table>";
                                _color.Text = strColor;

                                if (_name.Text == "")
                                {
                                    _name.Text = oService.GetName(_serviceid);
                                }
                                Label  _item        = (Label)ri.FindControl("lblItem");
                                Label  _allocated   = (Label)ri.FindControl("lblAllocated");
                                double dblAllocated = double.Parse(_allocated.Text);
                                Label  _used        = (Label)ri.FindControl("lblUsed");
                                double dblUsed      = oResourceRequest.GetWorkflowUsed(Int32.Parse(_id.Text));
                                Label  _percent     = (Label)ri.FindControl("lblPercent");
                                int    intItem2     = Int32.Parse(_item.Text);
                                if (intItem2 == 0)
                                {
                                    _item.Text = "Project Coordinator";
                                }
                                else
                                {
                                    if (intItem2 == -1)
                                    {
                                        _item.Text = "Pending Execution";
                                    }
                                    else
                                    {
                                        int intApp = oRequestItem.GetItemApplication(intItem2);
                                        _item.Text = oApplication.GetName(intApp);
                                    }
                                }
                                _allocated.Text = dblAllocated.ToString();
                                _used.Text      = dblUsed.ToString();
                                if (dblAllocated > 0)
                                {
                                    dblUsed       = dblUsed / dblAllocated;
                                    _percent.Text = dblUsed.ToString("P");
                                }
                                else
                                {
                                    _percent.Text = dblAllocated.ToString("P");
                                }
                                _status.Text = oStatus.Name(intStatus);
                            }
                        }
                    }
                    else
                    {
                        panDenied.Visible = true;
                        lblTitle.Text     = "Zero Dataset ";
                    }
                    LoadProject(intProject);
                }
            }
            else
            {
                panDenied.Visible = true;
                lblTitle.Text     = "Invalid Querystring ";
            }
            btnDenied.Attributes.Add("onclick", "return CloseWindow();");
            btnConfigure.Attributes.Add("onclick", "return ValidateText('" + txtNumber.ClientID + "','Please enter the project number');");
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            Master.Page.Title = "DataPoint | Project Search";
            if (Request.Cookies["profileid"] != null && Request.Cookies["profileid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            }
            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);
            }

            oDataPoint     = new DataPoint(intProfile, dsn);
            oFunction      = new Functions(intProfile, dsn, intEnvironment);
            oUser          = new Users(intProfile, dsn);
            oModel         = new Models(intProfile, dsn);
            oApplications  = new Applications(intProfile, dsn);
            oVariable      = new Variables(intEnvironment);
            oPage          = new Pages(intProfile, dsn);
            oOrganizations = new Organizations(intProfile, dsn);
            oStatusLevel   = new StatusLevels();

            if (oUser.IsAdmin(intProfile) == true || (oDataPoint.GetPagePermission(intApplication, "PROJECT") == true || intDataPointAvailableProject == 1))
            {
                pnlAllow.Visible = true;

                if (Request.QueryString["advanced"] == null)
                {
                    pnlBasicSearch.Visible       = true;
                    pnlAdvancedSearch.Visible    = false;
                    lnkbtnAdvancedSearch.Visible = true;
                    lnkbtnBasicSearch.Visible    = false;
                    btnAdvancedSearch.Visible    = false;
                    btnBasicSearch.Visible       = true;
                }
                else
                {
                    boolAdvSearch                = true;
                    pnlBasicSearch.Visible       = true;
                    pnlAdvancedSearch.Visible    = true;
                    lnkbtnAdvancedSearch.Visible = false;
                    lnkbtnBasicSearch.Visible    = true;
                    btnAdvancedSearch.Visible    = true;
                    btnBasicSearch.Visible       = false;
                }
                if (!IsPostBack)
                {
                    LoadList();
                }

                AddControlAttributes();
            }
            else
            {
                pnlDenied.Visible = true;
            }
        }
示例#15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            if (Request.Cookies["profileid"] != null && Request.Cookies["profileid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            }
            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);
            }
            oDataPoint        = new DataPoint(intProfile, dsn);
            oUser             = new Users(intProfile, dsn);
            oServer           = new Servers(intProfile, dsn);
            oAsset            = new Asset(intProfile, dsnAsset);
            oForecast         = new Forecast(intProfile, dsn);
            oPlatform         = new Platforms(intProfile, dsn);
            oType             = new Types(intProfile, dsn);
            oModel            = new Models(intProfile, dsn);
            oModelsProperties = new ModelsProperties(intProfile, dsn);
            oIPAddresses      = new IPAddresses(intProfile, dsnIP, dsn);
            oFunction         = new Functions(intProfile, dsn, intEnvironment);
            oOperatingSystem  = new OperatingSystems(intProfile, dsn);
            oServicePack      = new ServicePacks(intProfile, dsn);
            oClass            = new Classes(intProfile, dsn);
            oEnvironment      = new Environments(intProfile, dsn);
            oResiliency       = new Resiliency(intProfile, dsn);
            //oLocation = new Locations(intProfile, dsn);
            //oRoom = new Rooms(intProfile, dsn);
            //oRack = new Racks(intProfile, dsn);
            oStatusList = new StatusLevels(intProfile, dsn);
            if (oUser.IsAdmin(intProfile) == true || (oDataPoint.GetPagePermission(intApplication, "ASSET") == true || intDataPointAvailableAsset == 1))
            {
                panAllow.Visible = true;
                if (Request.QueryString["save"] != null)
                {
                    panSave.Visible = true;
                }
                if (Request.QueryString["error"] != null)
                {
                    panError.Visible = true;
                    lblError.Text    = "Name Already Exists";
                }
                if (Request.QueryString["close"] != null)
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "close", "<script type=\"text/javascript\">window.close();<" + "/" + "script>");
                }
                else if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    string  strID = oFunction.decryptQueryString(Request.QueryString["id"]);
                    DataSet ds    = oDataPoint.GetAsset(Int32.Parse(strID));
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        // Load General Information
                        intAsset        = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                        lblAssetID.Text = "#" + intAsset.ToString();
                        string strSerial = ds.Tables[0].Rows[0]["serial"].ToString();
                        string strAsset  = ds.Tables[0].Rows[0]["asset"].ToString();

                        string strHeader = (strSerial.Length > 15 ? strSerial.Substring(0, 15) + "..." : strSerial);
                        lblHeader.Text    = "&quot;" + strHeader.ToUpper() + "&quot;";
                        Master.Page.Title = "DataPoint | Enclosure Deploy (" + strHeader + ")";
                        lblHeaderSub.Text = "Complete the following information to deploy an enclosure...";
                        int intMenuTab = 0;
                        if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
                        {
                            intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
                        }
                        Tab oTab = new Tab(hdnTab.ClientID, intMenuTab, "divMenu1", true, false);
                        oTab.AddTab("Asset Information", "");
                        oTab.AddTab("Location Information", "");
                        oTab.AddTab("Virtual Connect IPs", "");
                        oTab.AddTab("Resource Dependencies", "");
                        oTab.AddTab("Provisioning History", "");
                        strMenuTab1 = oTab.GetTabs();

                        if (oUser.IsAdmin(intProfile) == true || oDataPoint.GetFieldPermission(intProfile, "SERVER_ADMIN") == true)
                        {
                            panOldLocationInfo.Visible = true;
                        }

                        if (!IsPostBack)
                        {
                            LoadList();

                            // Asset Information
                            oDataPoint.LoadTextBox(txtPlatformSerial, intProfile, null, "", lblPlatformSerial, fldPlatformSerial, "ENCLOSURE_SERIAL", strSerial, "", false, true);
                            oDataPoint.LoadTextBox(txtPlatformAsset, intProfile, null, "", lblPlatformAsset, fldPlatformAsset, "ENCLOSURE_ASSET", strAsset, "", false, true);

                            int intAssetAttribute = Int32.Parse(oAsset.Get(intAsset, "asset_attribute"));
                            oDataPoint.LoadDropDown(ddlAssetAttribute, intProfile, null, "", lblAssetAttribute, fldAssetAttribute, "ASSET_ATTRIBUTE", "Name", "AttributeId", oAsset.getAssetAttributes(null, "", 1), intAssetAttribute, true, false, false);
                            oDataPoint.LoadTextBox(txtAssetAttributeComment, intProfile, null, "", lblAssetAttributeComment, fldAssetAttributeComment, "ASSET_ATTRIBUTE_COMMENT", oAsset.getAssetAttributesComments(intAsset), "", false, true);
                            ddlAssetAttribute.Attributes.Add("onclick", "return SetControlsForAssetAttributes()");

                            ddlPlatform.Attributes.Add("onchange", "PopulatePlatformTypes('" + ddlPlatform.ClientID + "','" + ddlPlatformType.ClientID + "','" + ddlPlatformModel.ClientID + "','" + ddlPlatformModelProperty.ClientID + "');ResetDropDownHidden('" + hdnModel.ClientID + "');");
                            ddlPlatformType.Attributes.Add("onchange", "PopulatePlatformModels('" + ddlPlatformType.ClientID + "','" + ddlPlatformModel.ClientID + "','" + ddlPlatformModelProperty.ClientID + "');ResetDropDownHidden('" + hdnModel.ClientID + "');");
                            ddlPlatformModel.Attributes.Add("onchange", "PopulatePlatformModelProperties('" + ddlPlatformModel.ClientID + "','" + ddlPlatformModelProperty.ClientID + "');ResetDropDownHidden('" + hdnModel.ClientID + "');");
                            ddlPlatformModelProperty.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlPlatformModelProperty.ClientID + "','" + hdnModel.ClientID + "');");
                            int intModel  = Int32.Parse(oAsset.Get(intAsset, "modelid"));
                            int intParent = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
                            if (oDataPoint.GetDeployModel(intProfile, intParent) == false && oUser.IsAdmin(intProfile) == false)
                            {
                                panAllow.Visible  = false;
                                panDenied.Visible = true;
                            }

                            hdnModel.Value = intModel.ToString();
                            int intModelParent = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
                            int intType        = oModel.GetType(intModelParent);
                            int intPlatform    = oType.GetPlatform(intType);
                            oDataPoint.LoadDropDown(ddlPlatform, intProfile, null, "", lblPlatform, fldPlatform, "ENCLOSURE_PLATFORM", "name", "platformid", oPlatform.Gets(1), intPlatform, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformType, intProfile, null, "", lblPlatformType, fldPlatformType, "ENCLOSURE_TYPE", "name", "id", oType.Gets(intPlatform, 1), intType, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformModel, intProfile, null, "", lblPlatformModel, fldPlatformModel, "ENCLOSURE_MODEL", "name", "id", oModel.Gets(intType, 1), intModelParent, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformModelProperty, intProfile, null, "", lblPlatformModelProperty, fldPlatformModelProperty, "ENCLOSURE_MODEL_PROP", "name", "id", oModelsProperties.GetModels(0, intModelParent, 1), intModel, false, false, true);

                            // Get Asset
                            DataSet dsAsset = oAsset.GetEnclosure(intAsset);
                            if (dsAsset.Tables[0].Rows.Count > 0)
                            {
                                Response.Redirect("/datapoint/asset/enclosure.aspx?t=serial&q=" + oFunction.encryptQueryString(strSerial) + "&id=" + oFunction.encryptQueryString(intAsset.ToString()) + "&r=0");
                            }

                            txtName.Text = oAsset.GetStatus(intAsset, "name");
                            oDataPoint.LoadTextBox(txtName, intProfile, null, "", lblName, fldName, "ENCLOSURE_NAME", "", "", false, true);
                            oDataPoint.LoadDropDown(ddlPlatformClass, intProfile, null, "", lblPlatformClass, fldPlatformClass, "ENCLOSURE_CLASS", "name", "id", oClass.Gets(1), 0, false, false, true);
                            oDataPoint.LoadDropDown(ddlPlatformEnvironment, intProfile, null, "", lblPlatformEnvironment, fldPlatformEnvironment, "ENCLOSURE_ENVIRONMENT", "name", "id", oClass.GetEnvironment(0, 0), 0, false, false, true);
                            oDataPoint.LoadTextBox(txtPlatformVLAN, intProfile, null, "", lblPlatformVLAN, fldPlatformVLAN, "ENCLOSURE_VLAN", "", "", false, true);
                            oDataPoint.LoadTextBox(txtPlatformOA, intProfile, null, "", lblPlatformOA, fldPlatformOA, "ENCLOSURE_OA", "", "", false, true);
                            oDataPoint.LoadDropDown(ddlPlatformResiliency, intProfile, null, "", lblPlatformResiliency, fldPlatformResiliency, "ENCLOSURE_RESILIENCY", "name", "id", oResiliency.Gets(1), 0, false, false, true);


                            if (dsAsset.Tables[0].Rows.Count > 0)
                            {
                                lblOldlocation.Text = dsAsset.Tables[0].Rows[0]["OldLocation"].ToString();
                                lblOldRoom.Text     = dsAsset.Tables[0].Rows[0]["OldRoom"].ToString();
                                lblOldRack.Text     = dsAsset.Tables[0].Rows[0]["OldRack"].ToString();

                                txtLocation.Text     = dsAsset.Tables[0].Rows[0]["Location"].ToString();
                                txtRoom.Text         = dsAsset.Tables[0].Rows[0]["Room"].ToString();
                                txtZone.Text         = dsAsset.Tables[0].Rows[0]["Zone"].ToString();
                                txtRack.Text         = dsAsset.Tables[0].Rows[0]["Rack"].ToString();
                                txtRackPosition.Text = dsAsset.Tables[0].Rows[0]["Rackposition"].ToString();
                                oDataPoint.LoadTextBox(txtRackPosition, intProfile, null, "", lblRackPositionValue, fldLocation, "CHANGE_LOCATION", dsAsset.Tables[0].Rows[0]["rackposition"].ToString(), "", false, true);
                                hdnRackId.Value = dsAsset.Tables[0].Rows[0]["NewRackId"].ToString();
                            }
                            oDataPoint.LoadButton(btnSelectLocation, intProfile, fldLocation, "CHANGE_LOCATION",
                                                  "return LoadLocationRoomRack('" + "rack" + "','" + hdnRackId.ClientID + "', '" + txtLocation.ClientID + "','" + txtRoom.ClientID + "','" + txtZone.ClientID + "','" + txtRack.ClientID + "');");

                            ddlPlatformStatus.SelectedValue = oAsset.GetStatus(intAsset, "status");

                            // Resource Dependencies
                            AssetOrder      oAssetOrder     = new AssetOrder(0, dsn, dsnAsset, intEnvironment);
                            Services        oService        = new Services(0, dsn);
                            ServiceRequests oServiceRequest = new ServiceRequests(0, dsn);
                            rptServiceRequests.DataSource = oAssetOrder.GetByAsset(intAsset, false);
                            rptServiceRequests.DataBind();
                            trServiceRequests.Visible = (rptServiceRequests.Items.Count == 0);
                            foreach (RepeaterItem ri in rptServiceRequests.Items)
                            {
                                Label lblServiceID = (Label)ri.FindControl("lblServiceID");
                                int   intService   = Int32.Parse(lblServiceID.Text);
                                Label lblDetails   = (Label)ri.FindControl("lblDetails");
                                Label lblProgress  = (Label)ri.FindControl("lblProgress");

                                if (lblProgress.Text == "")
                                {
                                    lblProgress.Text = "<i>Unavailable</i>";
                                }
                                else
                                {
                                    int     intResource  = Int32.Parse(lblProgress.Text);
                                    double  dblAllocated = 0.00;
                                    double  dblUsed      = 0.00;
                                    int     intStatus    = 0;
                                    bool    boolAssigned = false;
                                    DataSet dsResource   = oDataPoint.GetServiceRequestResource(intResource);
                                    if (dsResource.Tables[0].Rows.Count > 0)
                                    {
                                        Int32.TryParse(dsResource.Tables[0].Rows[0]["status"].ToString(), out intStatus);
                                    }
                                    foreach (DataRow drResource in dsResource.Tables[1].Rows)
                                    {
                                        boolAssigned  = true;
                                        dblAllocated += double.Parse(drResource["allocated"].ToString());
                                        dblUsed      += double.Parse(drResource["used"].ToString());
                                        intStatus     = Int32.Parse(drResource["status"].ToString());
                                    }
                                    if (intStatus == (int)ResourceRequestStatus.Closed)
                                    {
                                        lblProgress.Text = oServiceRequest.GetStatusBar(100.00, "100", "12", true);
                                    }
                                    else if (intStatus == (int)ResourceRequestStatus.Cancelled)
                                    {
                                        lblProgress.Text = "Cancelled";
                                    }
                                    else if (boolAssigned == false)
                                    {
                                        string  strManager = "";
                                        DataSet dsManager  = oService.GetUser(intService, 1); // Managers
                                        foreach (DataRow drManager in dsManager.Tables[0].Rows)
                                        {
                                            if (strManager != "")
                                            {
                                                strManager += "\\n";
                                            }
                                            int intManager = Int32.Parse(drManager["userid"].ToString());
                                            strManager += " - " + oUser.GetFullName(intManager) + " [" + oUser.GetName(intManager) + "]";
                                        }
                                        lblProgress.Text = "<a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"alert('This request is pending assignment by the following...\\n\\n" + strManager + "');\">Pending Assignment</a>";
                                    }
                                    else if (dblAllocated > 0.00)
                                    {
                                        lblProgress.Text = oServiceRequest.GetStatusBar((dblUsed / dblAllocated) * 100.00, "100", "12", true);
                                    }
                                    else
                                    {
                                        lblProgress.Text = "<i>N / A</i>";
                                    }
                                    lblDetails.Text = "<a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"OpenNewWindowMenu('/datapoint/service/resource.aspx?id=" + oFunction.encryptQueryString(intResource.ToString()) + "', '800', '600');\">" + lblDetails.Text + "</a>";
                                }
                            }

                            // Provioning History
                            rptHistory.DataSource = oAsset.GetProvisioningHistory(intAsset);
                            rptHistory.DataBind();
                            lblHistory.Visible = (rptHistory.Items.Count == 0);

                            // Virtual Connects
                            rptVirtualConnect.DataSource = oAsset.GetEnclosureVCs(intAsset, 1);
                            rptVirtualConnect.DataBind();
                            lblVirtualConnect.Visible = (rptVirtualConnect.Items.Count == 0);
                            btnVCs.Attributes.Add("onclick", "return OpenWindow('ASSET_DEPLOY_VCs','" + intAsset.ToString() + "');");
                        }
                    }
                    else
                    {
                        if (Request.QueryString["t"] != null && Request.QueryString["q"] != null)
                        {
                            Response.Redirect("/datapoint/asset/datapoint_asset_search.aspx?t=" + Request.QueryString["t"] + "&q=" + Request.QueryString["q"] + "&r=0");
                        }
                        else
                        {
                            Response.Redirect("/datapoint/asset/datapoint_asset_search.aspx");
                        }
                    }
                }
                else
                {
                    Response.Redirect("/datapoint/asset/datapoint_asset_search.aspx");
                }
                btnClose.Attributes.Add("onclick", "window.close();return false;");
                btnPrint.Attributes.Add("onclick", "window.print();return false;");
                btnDeploy.Attributes.Add("onclick", oDataPoint.LoadValidation());
                ddlPlatformClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlPlatformClass.ClientID + "','" + ddlPlatformEnvironment.ClientID + "',0);");
                ddlPlatformEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlPlatformEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
                //ddlLocationState.Attributes.Add("onchange", "LoadLocationCity('" + ddlLocationCity.ClientID + "');LoadLocationAddress('" + ddlLocationAddress.ClientID + "');PopulateCitys('" + ddlLocationState.ClientID + "','" + ddlLocationCity.ClientID + "');ResetDropDownHidden('" + hdnAddress.ClientID + "');");
                //ddlLocationCity.Attributes.Add("onchange", "LoadLocationAddress('" + ddlLocationAddress.ClientID + "');PopulateAddresss('" + ddlLocationCity.ClientID + "','" + ddlLocationAddress.ClientID + "');ResetDropDownHidden('" + hdnAddress.ClientID + "');");
                //ddlLocationAddress.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlLocationAddress.ClientID + "','" + hdnAddress.ClientID + "');");
            }
            else
            {
                panDenied.Visible = true;
            }
        }
示例#16
0
        protected void LoadSearch(int _search)
        {
            Search          oSearch          = new Search(intProfile, dsn);
            RequestItems    oRequestItem     = new RequestItems(intProfile, dsn);
            Services        oService         = new Services(intProfile, dsn);
            Applications    oApplication     = new Applications(intProfile, dsn);
            StatusLevels    oStatusLevel     = new StatusLevels();
            Users           oUser            = new Users(intProfile, dsn);
            Projects        oProject         = new Projects(intProfile, dsn);
            ResourceRequest oResourceRequest = new ResourceRequest(intProfile, dsn);
            ServiceRequests oServiceRequest  = new ServiceRequests(intProfile, dsn);
            DataSet         ds             = oSearch.GetProject(_search);
            int             intApplication = 0;

            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 (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["userid"].ToString() == intProfile.ToString())
                {
                    string strType        = ds.Tables[0].Rows[0]["type"].ToString();
                    string strClause      = "cv_projects.deleted = 0 AND cv_projects.number NOT LIKE 'CV%' AND cv_projects.number NOT LIKE 'EPS%'";
                    string strOr1         = "";
                    string strOr2         = "";
                    string strSQL         = "SELECT DISTINCT '?pid=' + CAST(cv_projects.projectid AS varchar(10)) + '&sid=" + _search.ToString() + "' AS query, cv_projects.name, cv_projects.number, cv_projects.status, cv_projects.modified FROM cv_projects INNER JOIN cv_requests LEFT OUTER JOIN cv_service_requests ON cv_service_requests.requestid = cv_requests.requestid AND cv_service_requests.deleted = 0 LEFT OUTER JOIN cv_project_requests ON cv_project_requests.requestid = cv_requests.requestid AND cv_project_requests.deleted = 0 INNER JOIN cv_resource_requests INNER JOIN cv_request_items INNER JOIN cv_applications ON cv_request_items.applicationid = cv_applications.applicationid AND cv_applications.deleted = 0 ON cv_request_items.itemid = cv_resource_requests.itemid AND cv_request_items.deleted = 0 INNER JOIN cv_users ON cv_resource_requests.userid = cv_users.userid AND cv_users.deleted = 0 AND cv_users.enabled = 1 ON cv_requests.requestid = cv_resource_requests.requestid AND cv_resource_requests.deleted = 0 ON cv_requests.projectid = cv_projects.projectid AND cv_requests.deleted = 0 WHERE ";
                    string strApplication = " AND cv_request_items.applicationid = " + intApplication.ToString();
                    switch (strType)
                    {
                    case "O":
                        strApplication = "";
                        string strOName   = ds.Tables[0].Rows[0]["oname"].ToString().Trim();
                        string strONumber = ds.Tables[0].Rows[0]["onumber"].ToString().Trim();
                        if (strONumber != "")
                        {
                            strClause      += " AND cv_projects.number LIKE '%" + strONumber + "%'";
                            lblResults.Text = "Project Number LIKE &quot;" + strONumber + "&quot;";
                        }
                        else
                        {
                            strClause      += " AND cv_projects.name LIKE '%" + strOName + "%'";
                            lblResults.Text = "Project Name LIKE &quot;" + strOName + "&quot;";
                        }
                        string strOStatus = ds.Tables[0].Rows[0]["ostatus"].ToString();
                        if (strOStatus != "0")
                        {
                            strClause += " AND cv_projects.status = " + strOStatus;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Status = &quot;" + oStatusLevel.Name(Int32.Parse(strOStatus)) + "&quot;";
                        }
                        string strOStart = ds.Tables[0].Rows[0]["ostart"].ToString();
                        if (strOStart != "")
                        {
                            strOStart  = DateTime.Parse(strOStart).ToShortDateString();
                            strClause += " AND cv_projects.modified > " + strOStart;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Project Date > &quot;" + strOStart + "&quot;";
                        }
                        string strOEnd = ds.Tables[0].Rows[0]["oend"].ToString();
                        if (strOEnd != "")
                        {
                            strOEnd    = DateTime.Parse(strOEnd).ToShortDateString();
                            strClause += " AND cv_projects.modified < " + strOEnd;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Project Date < &quot;" + strOEnd + "&quot;";
                        }
                        break;

                    case "P":
                        string strDepartment = ds.Tables[0].Rows[0]["department"].ToString();
                        if (strDepartment == "0")
                        {
                            strApplication   = "";
                            lblResults.Text += "Department = &quot;ALL&quot;";
                        }
                        else
                        {
                            strApplication   = " AND cv_request_items.applicationid = " + strDepartment;
                            lblResults.Text += "Department = &quot;" + oApplication.GetName(Int32.Parse(strDepartment)) + "&quot;";
                        }
                        string strDStatus = ds.Tables[0].Rows[0]["dstatus"].ToString();
                        if (strDStatus != "0")
                        {
                            strClause += " AND cv_resource_requests.status = " + strDStatus;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Status = &quot;" + oStatusLevel.Name(Int32.Parse(strDStatus)) + "&quot;";
                        }
                        string strDStart = ds.Tables[0].Rows[0]["dstart"].ToString();
                        if (strDStart != "")
                        {
                            strDStart  = DateTime.Parse(strDStart).ToShortDateString();
                            strClause += " AND cv_requests.modified > " + strDStart;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Request Date > &quot;" + strDStart + "&quot;";
                        }
                        string strDEnd = ds.Tables[0].Rows[0]["dend"].ToString();
                        if (strDEnd != "")
                        {
                            strDEnd    = DateTime.Parse(strDEnd).ToShortDateString();
                            strClause += " AND cv_requests.modified < " + strDEnd;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Request Date < &quot;" + strDEnd + "&quot;";
                        }
                        break;

                    case "T":
                        string strTechnician = ds.Tables[0].Rows[0]["technician"].ToString();
                        if (strTechnician != "0")
                        {
                            strClause       += " AND cv_resource_requests.userid = " + strTechnician;
                            lblResults.Text += "Technician = &quot;" + oUser.GetFullName(Int32.Parse(strTechnician)) + "&quot;";
                        }
                        string strTStatus = ds.Tables[0].Rows[0]["tstatus"].ToString();
                        if (strTStatus != "0")
                        {
                            strClause += " AND cv_resource_requests.status = " + strTStatus;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Status = &quot;" + oStatusLevel.Name(Int32.Parse(strTStatus)) + "&quot;";
                        }
                        string strTStart = ds.Tables[0].Rows[0]["tstart"].ToString();
                        if (strTStart != "")
                        {
                            strTStart  = DateTime.Parse(strTStart).ToShortDateString();
                            strClause += " AND cv_requests.modified > " + strTStart;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Request Date > &quot;" + strTStart + "&quot;";
                        }
                        string strTEnd = ds.Tables[0].Rows[0]["tend"].ToString();
                        if (strTEnd != "")
                        {
                            strTEnd    = DateTime.Parse(strTEnd).ToShortDateString();
                            strClause += " AND cv_requests.modified < " + strTEnd;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Request Date < &quot;" + strTEnd + "&quot;";
                        }
                        break;

                    case "L":
                        string strLead = ds.Tables[0].Rows[0]["lead"].ToString();
                        if (strLead != "0")
                        {
                            int intLead = Int32.Parse(strLead);
                            strClause       += " AND cv_users.manager = " + intLead.ToString();
                            lblResults.Text += "Team Lead = &quot;" + oUser.GetFullName(intLead) + "&quot;";
                        }
                        string strLStatus = ds.Tables[0].Rows[0]["lstatus"].ToString();
                        if (strLStatus != "0")
                        {
                            strClause += " AND cv_resource_requests.status = " + strLStatus;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Status = &quot;" + oStatusLevel.Name(Int32.Parse(strLStatus)) + "&quot;";
                        }
                        string strLStart = ds.Tables[0].Rows[0]["lstart"].ToString();
                        if (strLStart != "")
                        {
                            strLStart  = DateTime.Parse(strLStart).ToShortDateString();
                            strClause += " AND cv_requests.modified > " + strLStart;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Request Date < &quot;" + strLStart + "&quot;";
                        }
                        string strLEnd = ds.Tables[0].Rows[0]["lend"].ToString();
                        if (strLEnd != "")
                        {
                            strLEnd    = DateTime.Parse(strLEnd).ToShortDateString();
                            strClause += " AND cv_requests.modified < " + strLEnd;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Request Date > &quot;" + strLEnd + "&quot;";
                        }
                        break;

                    case "G":
                        string strItem = ds.Tables[0].Rows[0]["itemid"].ToString();
                        if (strItem != "0")
                        {
                            strClause       += " AND cv_resource_requests.itemid = " + strItem;
                            lblResults.Text += "Activity Type = &quot;" + oRequestItem.GetItemName(Int32.Parse(strItem)) + "&quot;";
                        }
                        string strGStatus = ds.Tables[0].Rows[0]["gstatus"].ToString();
                        if (strGStatus != "0")
                        {
                            strClause += " AND cv_resource_requests.status = " + strGStatus;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Status = &quot;" + oStatusLevel.Name(Int32.Parse(strGStatus)) + "&quot;";
                        }
                        string strGStart = ds.Tables[0].Rows[0]["gstart"].ToString();
                        if (strGStart != "")
                        {
                            strGStart  = DateTime.Parse(strGStart).ToShortDateString();
                            strClause += " AND cv_requests.modified > " + strGStart;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Request Date < &quot;" + strGStart + "&quot;";
                        }
                        string strGEnd = ds.Tables[0].Rows[0]["gend"].ToString();
                        if (strGEnd != "")
                        {
                            strGEnd    = DateTime.Parse(strGEnd).ToShortDateString();
                            strClause += " AND cv_requests.modified < " + strGEnd;
                            if (lblResults.Text != "")
                            {
                                lblResults.Text += " AND ";
                            }
                            lblResults.Text += "Request Date > &quot;" + strGEnd + "&quot;";
                        }
                        break;

                    case "S":
                        break;
                    }
                    strClause = strClause + strApplication;
                    if (strOr1 != "" && strOr2 != "")
                    {
                        strClause = strClause + " AND " + strOr1 + " AND cv_project_requests.id IS NOT NULL OR " + strClause + " AND " + strOr1 + " AND cv_service_requests.id IS NOT NULL OR " + strClause + " AND " + strOr2 + " AND cv_project_requests.id IS NOT NULL OR " + strClause + " AND " + strOr2 + " AND cv_service_requests.id IS NOT NULL";
                    }
                    else
                    {
                        strClause = strClause + " AND cv_project_requests.id IS NOT NULL OR " + strClause + " AND cv_service_requests.id IS NOT NULL";
                    }
                    ds = SqlHelper.ExecuteDataset(dsn, CommandType.Text, strSQL + strClause);
                    DataView dv = ds.Tables[0].DefaultView;
                    if (Request.QueryString["sort"] != null)
                    {
                        dv.Sort = Request.QueryString["sort"];
                    }
                    rptView.DataSource = dv;
                    rptView.DataBind();
                    foreach (RepeaterItem ri in rptView.Items)
                    {
                        Label _progress = (Label)ri.FindControl("lblProgress");
                        Label _status   = (Label)ri.FindControl("lblStatus");
                        _status.Text = oStatusLevel.HTML(Int32.Parse(_status.Text));
                        Label _updated = (Label)ri.FindControl("lblUpdated");
                        Label _number  = (Label)ri.FindControl("lblNumber");
                        if (_number.Text == "")
                        {
                            _number.Text = "<i>TBD...</i>";
                        }
                        double dblUsed      = 0.00;
                        double dblAllocated = 0.00;
                        if (_progress.Text.Contains("?pid=") == true)
                        {
                            int intProject = 0;
                            if (Request.QueryString["sid"] != null && Request.QueryString["sid"] != "")
                            {
                                string strProgress = _progress.Text.Substring(0, _progress.Text.IndexOf("&"));
                                intProject = Int32.Parse(strProgress.Substring(5));
                            }
                            else
                            {
                                intProject = Int32.Parse(_progress.Text.Substring(5));
                            }
                            _updated.Text = oProject.GetLastUpdated(intProject);
                            DataSet dsAll = oResourceRequest.GetWorkflowProject(intProject);
                            foreach (DataRow drAll in dsAll.Tables[0].Rows)
                            {
                                int intResourceWorkflow = Int32.Parse(drAll["id"].ToString());
                                dblAllocated += double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated"));
                                dblUsed      += oResourceRequest.GetWorkflowUsed(intResourceWorkflow);
                            }
                        }
                        else if (_progress.Text.Contains("?rid=") == true)
                        {
                            int     intRequest = Int32.Parse(_progress.Text.Substring(5));
                            DataSet dsAll      = oResourceRequest.GetWorkflowRequestAll(intRequest);
                            foreach (DataRow drAll in dsAll.Tables[0].Rows)
                            {
                                int intResourceWorkflow = Int32.Parse(drAll["id"].ToString());
                                dblAllocated += double.Parse(oResourceRequest.GetWorkflow(intResourceWorkflow, "allocated"));
                                dblUsed      += oResourceRequest.GetWorkflowUsed(intResourceWorkflow);
                            }
                        }
                        double dblProgress = 0.00;
                        if (dblAllocated > 0.00)
                        {
                            dblProgress = (dblUsed / dblAllocated) * 100.00;
                        }
                        _progress.Text = oServiceRequest.GetStatusBar(dblProgress, "100", "6", true);
                    }
                    lblNone.Visible = (rptView.Items.Count == 0);
                }
            }
        }
示例#17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oPage            = new Pages(intProfile, dsn);
            oOrganization    = new Organizations(intProfile, dsn);
            oSegment         = new Segment(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oSearch          = new Search(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oProject         = new Projects(intProfile, dsn);
            oStatusLevel     = new StatusLevels();
            oProjectRequest  = new ProjectRequest(intProfile, dsn);
            oDocument        = new Documents(intProfile, dsn);
            oStatus          = new StatusLevels();
            oApprove         = new ProjectRequest_Approval(intProfile, dsn, intEnvironment);
            oCustomized      = new Customized(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oFunction        = new Functions(intProfile, dsn, 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);
            }
            bool boolUserSearch = false;

            if (Request.QueryString["pid"] != null && Request.QueryString["pid"] != "")
            {
                int intProject = Int32.Parse(Request.QueryString["pid"]);
                strProjectName      = oProject.GetName(intProject);
                lblProjectName.Text = "&quot;" + strProjectName + "&quot;";
                // INVOLVEMENT
                DataSet dsInvolvement = oResourceRequest.GetWorkflowProject(intProject);
                int     intOldUser    = 0;
                foreach (DataRow dr in dsInvolvement.Tables[0].Rows)
                {
                    if (intOldUser == Int32.Parse(dr["userid"].ToString()))
                    {
                        dr.Delete();
                    }
                    else
                    {
                        intOldUser = Int32.Parse(dr["userid"].ToString());
                    }
                }
                dsInvolvement = oResourceRequest.GetWorkflowProject(intProject);
                int intOldItem = 0;
                intOldUser = 0;
                foreach (DataRow dr in dsInvolvement.Tables[0].Rows)
                {
                    if (intOldItem == Int32.Parse(dr["itemid"].ToString()) && intOldUser == Int32.Parse(dr["userid"].ToString()))
                    {
                        dr.Delete();
                    }
                    else
                    {
                        intOldItem = Int32.Parse(dr["itemid"].ToString());
                        intOldUser = Int32.Parse(dr["userid"].ToString());
                    }
                }
                rptInvolvement.DataSource = dsInvolvement;
                rptInvolvement.DataBind();
                lblNoInvolvement.Visible = (rptInvolvement.Items.Count == 0);
                foreach (RepeaterItem ri in rptInvolvement.Items)
                {
                    Label _id       = (Label)ri.FindControl("lblId");
                    Label _user     = (Label)ri.FindControl("lblUser");
                    Label _status   = (Label)ri.FindControl("lblStatus");
                    Label _image    = (Label)ri.FindControl("lblImage");
                    int   intStatus = Int32.Parse(_status.Text);
                    int   intUser   = Int32.Parse(_user.Text);
                    _user.Text = oUser.GetFullName(intUser);
                    Label  _item        = (Label)ri.FindControl("lblItem");
                    int    intItem2     = Int32.Parse(_item.Text);
                    Label  _allocated   = (Label)ri.FindControl("lblAllocated");
                    Label  _used        = (Label)ri.FindControl("lblUsed");
                    double dblAllocated = oResourceRequest.GetAllocated(intProject, intUser, intItem2);
                    double dblUsed      = oResourceRequest.GetUsed(intProject, intUser, intItem2);
                    Label  _percent     = (Label)ri.FindControl("lblPercent");
                    _allocated.Text = dblAllocated.ToString();
                    _used.Text      = dblUsed.ToString();
                    if (dblAllocated > 0)
                    {
                        dblUsed       = dblUsed / dblAllocated;
                        _percent.Text = dblUsed.ToString("P");
                    }
                    else
                    {
                        _percent.Text = dblAllocated.ToString("P");
                    }
                    bool boolTPMDone = false;
                    if (intItem2 == 0)
                    {
                        _item.Text = "Project Coordinator";
                    }
                    else if (intItem2 == -1)
                    {
                        _item.Text = "Design Implementation (Pending Execution)";
                    }
                    else
                    {
                        int intApp = oRequestItem.GetItemApplication(intItem2);
                        _item.Text = oApplication.GetName(intApp);
                    }
                    _status.Text = oStatus.Name(intStatus);
                    if (boolTPMDone == true)
                    {
                        _status.Text = "Closed";
                    }
                }
            }
        }
示例#18
0
        private string GetSummary(int _requestid, int _serviceid, int _number)
        {
            Users           oUser           = new Users(intProfile, dsn);
            ServiceRequests oServiceRequest = new ServiceRequests(intProfile, dsn);
            RequestItems    oRequestItem    = new RequestItems(intProfile, dsn);
            Applications    oApplication    = new Applications(intProfile, dsn);
            StatusLevels    oStatus         = new StatusLevels();
            StringBuilder   sbSummary       = new StringBuilder();
            DataSet         ds       = oResourceRequest.GetRequestService(_requestid, _serviceid, _number);
            int             intCount = 0;

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                intCount++;
                int    intResource  = Int32.Parse(dr["id"].ToString());
                int    intItem      = Int32.Parse(dr["itemid"].ToString());
                int    intNumber    = Int32.Parse(dr["number"].ToString());
                int    intStatus    = Int32.Parse(dr["status"].ToString());
                double dblAllocated = double.Parse(dr["allocated"].ToString());
                double dblProgress  = 0.00;
                if (intStatus == 3)
                {
                    dblProgress = 100.00;
                }
                else
                {
                    double dblUsed = oResourceRequest.GetWorkflowUsed(intResource);
                    if (dblAllocated > 0.00)
                    {
                        dblProgress = (dblUsed / dblAllocated) * 100.00;
                    }
                }
                string  strReason   = "Unavailable";
                int     intApproval = 0;
                DataSet dsReason    = oResourceRequest.GetApproval(_requestid, intItem, intNumber);
                if (dsReason.Tables[0].Rows.Count > 0)
                {
                    strReason = dsReason.Tables[0].Rows[0]["reason"].ToString().Trim();
                    if (strReason == "")
                    {
                        strReason = "<i>No additional information...</i>";
                    }
                    intApproval = Int32.Parse(dsReason.Tables[0].Rows[0]["approval"].ToString());
                }
                string strStatus  = oStatus.Name(intApproval);
                bool   boolResult = (intApproval == 1);
                sbSummary.Append("<tr>");
                sbSummary.Append("<td width=\"1\"><img src=\"/images/resource_people.gif\" border=\"0\" align=\"absmiddle\"></td>");
                int intUser = Int32.Parse(dr["userid"].ToString());
                sbSummary.Append("<td>");
                sbSummary.Append(intUser > 0 ? oUser.GetFullName(intUser) : "Pending Assignment");
                sbSummary.Append("</td>");
                sbSummary.Append("<td>");
                sbSummary.Append(oApplication.GetName(oRequestItem.GetItemApplication(Int32.Parse(dr["itemid"].ToString()))));
                sbSummary.Append("</td>");
                sbSummary.Append("<td nowrap align=\"center\">");
                sbSummary.Append(intUser > 0 ? strStatus : "---");
                sbSummary.Append("</td>");
                sbSummary.Append("<td nowrap width=\"100\">");
                sbSummary.Append(intUser > 0 ? oServiceRequest.GetStatusBar(dblProgress, "100", "14", true) : "---");
                sbSummary.Append("</td>");
                sbSummary.Append("<td width=\"1\" nowrap><a href=\"javascript:void(0);\" onclick=\"ShowHide('div");
                sbSummary.Append(intCount.ToString());
                sbSummary.Append("_1');\">[Details]</a>");
                sbSummary.Append(boolResult ? "&nbsp;<a href=\"javascript:void(0);\" onclick=\"ShowHide('div" + intCount.ToString() + "_2');\">[Result]</a>" : "");
                sbSummary.Append("</td>");
                sbSummary.Append("</tr>");
                sbSummary.Append("<tr>");
                sbSummary.Append("<td colspan=\"6\">");
                sbSummary.Append("<div id=\"div");
                sbSummary.Append(intCount.ToString());
                sbSummary.Append("_1\" style=\"display:none\">");
                sbSummary.Append(strReason);
                sbSummary.Append("</div>");

                if (boolResult == true)
                {
                    string  strResult = "";
                    DataSet dsResult  = oRequest.GetResult(_requestid, intItem, intNumber);
                    foreach (DataRow drResult in dsResult.Tables[0].Rows)
                    {
                        strResult += drResult["result"].ToString();
                    }
                    sbSummary.Append("<div id=\"div");
                    sbSummary.Append(intCount.ToString());
                    sbSummary.Append("_2\" style=\"display:none\">");
                    sbSummary.Append(strResult);
                    sbSummary.Append("</div>");
                }
                sbSummary.Append("</td>");
                sbSummary.Append("</tr>");
            }

            sbSummary.Insert(0, "<table width=\"100%\" cellpadding=\"3\" cellspacing=\"2\" border=\"0\"><tr><td></td><td><b><u>Technician:</u></b></td><td><b><u>Department:</u></b></td><td align=\"center\"><b><u>Status:</u></b></td><td><b><u>Progress:</u></b></td><td></td></tr>");
            sbSummary.Append("</table>");

            return(sbSummary.ToString());
        }
示例#19
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);
            oDocument        = new Documents(intProfile, dsn);
            oStatusLevel     = new StatusLevels(intProfile, dsn);
            oAssetOrder      = new AssetOrder(intProfile, dsn, dsnAsset, 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["rrid"] != null && Request.QueryString["rrid"] != "")
            {
                //Load Attributes
                if (!IsPostBack)
                {
                    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 Added Successfully');<" + "/" + "script>");
                    }


                    LoadLists();
                    oFunction.ConfigureToolButton(btnEmail, "/images/tool_email");
                    oFunction.ConfigureToolButton(btnPrint, "/images/tool_print");
                    oFunction.ConfigureToolButton(btnClose, "/images/tool_close");
                    oFunction.ConfigureToolButton(btnSave, "/images/tool_save");
                    oFunction.ConfigureToolButton(btnComplete, "/images/tool_complete");
                    oFunction.ConfigureToolButton(btnSLA, "/images/tool_sla");

                    btnDenied.Attributes.Add("onclick", "return CloseWindow();");
                    btnPrint.Attributes.Add("onclick", "return PrintWindow();");
                    btnClose.Attributes.Add("onclick", "return ExitWindow();");


                    btnSave.Attributes.Add("onclick", "return ValidateText('" + txtNickName.ClientID + "','Please enter the nick name')" +
                                           " && ValidateNumber('" + txtApprovedQuantity.ClientID + "','Please enter the quantity.')" +
                                           //" && ValidateNumber('" + txtProcureQuantity.ClientID + "','Please enter the quantity.')" +
                                           //" && ValidateNumber('" + txtReDeployQuantity.ClientID + "','Please enter the re-deploy quantity.')" +
                                           //" && ValidateNumber('" + txtReturnedQuantity.ClientID + "','Please enter the returned quantity.')" +
                                           " && ValidateDropDown('" + ddlPurchaseOrderStatus.ClientID + "','Please select the purchase order status')" +
                                           " && ValidatePurchaseOrderStatus()" +
                                           ";");
                    //" && ValidateStatus('" + ddlStatus.ClientID + "','" + txtComments.ClientID + "')" +
                    btnStatus.Attributes.Add("onclick", "return ValidateStatus('" + ddlStatus.ClientID + "','" + txtComments.ClientID + "')" +
                                             ";");

                    imgBtnPurchaseOrderDate.Attributes.Add("onclick", "return ShowCalendar('" + txtPurchaseOrderDate.ClientID + "');");
                    imgApprovedOn.Attributes.Add("onclick", "return ShowCalendar('" + txtApprovedOn.ClientID + "');");
                    imgQuoteDate.Attributes.Add("onclick", "return ShowCalendar('" + txtQuoteDate.ClientID + "','" + txtWarrantyDate.ClientID + "',1095);");
                    imgBtnVendorOrderDate.Attributes.Add("onclick", "return ShowCalendar('" + txtVendorOrderDate.ClientID + "');");
                    txtAttentionTo.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'250','195','" + divAttentionTo.ClientID + "','" + lstAttentionTo.ClientID + "','" + hdnAttentionTo.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
                    lstAttentionTo.Attributes.Add("ondblclick", "AJAXClickRow();");
                    txtProjectManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'250','195','" + divProjectManager.ClientID + "','" + lstProjectManager.ClientID + "','" + hdnProjectManager.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
                    lstProjectManager.Attributes.Add("ondblclick", "AJAXClickRow();");


                    imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
                }

                LoadRequest();
            }
            else
            {
                panDenied.Visible = true;
            }
        }
示例#20
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;
            }
        }
示例#21
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 + "');");
        }
示例#22
0
        private void LoopRepeater(string _sort, int _start)
        {
            DataSet ds        = oForecast.Gets();
            double  dblCount1 = 0;

            DataColumn dc1 = new DataColumn("implementation", System.Type.GetType("System.DateTime"));

            ds.Tables[0].Columns.Add(dc1);
            DataColumn dc2 = new DataColumn("quantity", System.Type.GetType("System.Int32"));

            ds.Tables[0].Columns.Add(dc2);
            DataColumn dc3 = new DataColumn("amp", System.Type.GetType("System.Double"));

            ds.Tables[0].Columns.Add(dc3);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                int      intForecast = Int32.Parse(dr["id"].ToString());
                DataSet  dsAnswers   = oForecast.GetAnswers(intForecast);
                DateTime _date       = DateTime.MaxValue;
                foreach (DataRow drAnswer in dsAnswers.Tables[0].Rows)
                {
                    //bool boolOverride = (dr["override"].ToString() == "1");
                    if (drAnswer["implementation"].ToString() != "")
                    {
                        DateTime _commitment = DateTime.Parse(drAnswer["implementation"].ToString());
                        if (_commitment < _date)
                        {
                            _date = _commitment;
                        }
                    }
                    double dblQuantity = double.Parse(drAnswer["quantity"].ToString()) + double.Parse(drAnswer["recovery_number"].ToString());
                    dblCount1 += dblQuantity;
                }
                //dblCount2 += dblCount1;
                dr["implementation"] = _date.ToShortDateString();
                dr["quantity"]       = dblCount1.ToString();
                dblCount1            = 0.00;
            }



            if (_start > ds.Tables[0].Rows.Count)
            {
                _start = 0;
            }
            intRecordStart = _start + 1;
            DataView dv = ds.Tables[0].DefaultView;

            if (Request.QueryString["sort"] != null)
            {
                dv.Sort = Request.QueryString["sort"];
            }
            dv.RowFilter = LoadFilter();
            LoadLists(dv);
            int intCount = _start + intRecords;

            if (dv.Count < intCount)
            {
                intCount = dv.Count;
            }
            int ii = 0;

            lblRecords.Text = "Models " + intRecordStart.ToString() + " - " + intCount.ToString() + " of " + dv.Count.ToString();
            for (ii = 0; ii < _start && ii < intCount; ii++)
            {
                dv[0].Delete();
            }
            int intTotalCount = (dv.Count - intRecords);

            for (ii = 0; ii < intTotalCount; ii++)
            {
                dv[intRecords].Delete();
            }
            rptView.DataSource = dv;
            rptView.DataBind();
            Projects        oProject        = new Projects(intProfile, dsn);
            Requests        oRequest        = new Requests(intProfile, dsn);
            ProjectsPending oProjectPending = new ProjectsPending(intProfile, dsn, intEnvironment);
            Users           oUser           = new Users(intProfile, dsn);
            StatusLevels    oStatusLevel    = new StatusLevels();

            //foreach (RepeaterItem ri in rptView.Items)
            //{
            //    Label lblProject = (Label)ri.FindControl("lblProject");
            //    int intProject = Int32.Parse(lblProject.Text);
            //    Label lblRequest = (Label)ri.FindControl("lblRequest");
            //    int intRequest = Int32.Parse(lblRequest.Text);
            //    if (intProject > 0)
            //    {
            //        ds = oForecast.GetProject(intProject);
            //    }
            //    else
            //    {
            //        ds = oForecast.GetRequest(intRequest);
            //    }
            //    double dblAmp = 0.00;
            //    if (ds.Tables[0].Rows.Count > 0)
            //    {
            //        Label lblCount = (Label)ri.FindControl("lblCount");
            //        Label lblDate = (Label)ri.FindControl("lblDate");
            //        int intForecast = Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString());
            //        Platforms oPlatform = new Platforms(intProfile, dsn);
            //        ModelsProperties oModelsProperties = new ModelsProperties(intProfile, dsn);
            //        ds = oForecast.GetAnswers(intForecast);
            //        DateTime _date = DateTime.MaxValue;
            //        foreach (DataRow dr in ds.Tables[0].Rows)
            //        {
            //            //bool boolOverride = (dr["override"].ToString() == "1");
            //            if (dr["implementation"].ToString() != "")
            //            {
            //                DateTime _commitment = DateTime.Parse(dr["implementation"].ToString());
            //                if (_commitment < _date)
            //                    _date = _commitment;
            //            }
            //        //    // Get AMP
            //        //    int intModel = 0;
            //        //    int intServerModel = oForecast.GetModel(Int32.Parse(dr["id"].ToString()));
            //        //    if (intServerModel == 0)
            //        //    {
            //        //        // Get the model selected in the equipment dropdown (if not server)
            //        //        intModel = Int32.Parse(dr["modelid"].ToString());
            //        //        if (boolOverride == true && intModel > 0)
            //        //        {
            //        //            intServerModel = intModel;
            //        //            intModel = Int32.Parse(oModelsProperties.Get(intModel, "modelid"));
            //        //        }
            //        //    }
            //        //    if (intServerModel > 0)
            //        //        dblAmp += (double.Parse(oModelsProperties.Get(intServerModel, "amp")) * dblQuantity);
            //        //    else if (intModel > 0)
            //        //    {
            //        //        if (oModelsProperties.Get(intModel).Tables[0].Rows.Count > 0)
            //        //        {
            //        //            double dblAmpTemp = (double.Parse(oModelsProperties.Get(intModel, "amp")) * dblQuantity);
            //        //            dblAmp += dblAmpTemp;
            //        //        }
            //        //    }
            //        //    else
            //        //    {
            //        //        DataSet dsVendor = oForecast.GetAnswer(Int32.Parse(dr["id"].ToString()));
            //        //        if (dsVendor.Tables[0].Rows.Count > 0 && dsVendor.Tables[0].Rows[0]["modelname"].ToString() != "")
            //        //            dblAmp += (double.Parse(dsVendor.Tables[0].Rows[0]["amp"].ToString()) * dblQuantity);
            //        //    }
            //        }
            //        lblDate.Text = (_date == DateTime.MaxValue ? "---" : _date.ToShortDateString());
            //        lblCount.Text = dblCount2.ToString();
            //    }
            //    Label lblAmp = (Label)ri.FindControl("lblAmp");
            //    lblAmp.Text = dblAmp.ToString("F");
            //}
            lblNone.Visible = (rptView.Items.Count == 0);
            _start++;
        }
示例#23
0
        private void LoopRepeater(string _sort, int _start)
        {
            //DataSet ds = oForecast.Gets();
            DataSet ds        = oDesign.Gets();
            double  dblCount1 = 0;

            DataColumn dc1 = new DataColumn("implementation", System.Type.GetType("System.String"));

            ds.Tables[0].Columns.Add(dc1);
            DataColumn dc2 = new DataColumn("quantity", System.Type.GetType("System.Int32"));

            ds.Tables[0].Columns.Add(dc2);
            DataColumn dc3 = new DataColumn("amp", System.Type.GetType("System.Double"));

            ds.Tables[0].Columns.Add(dc3);
            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                int intForecast = Int32.Parse(dr["id"].ToString());
                //DataSet dsAnswers = oForecast.GetAnswers(intForecast);
                DataSet  dsAnswers = oDesign.Gets(intForecast);
                DateTime _date     = DateTime.MaxValue;
                foreach (DataRow drAnswer in dsAnswers.Tables[0].Rows)
                {
                    //bool boolOverride = (dr["override"].ToString() == "1");
                    if (drAnswer["commitment"].ToString() != "")
                    {
                        DateTime _commitment = DateTime.Parse(drAnswer["commitment"].ToString());
                        if (_commitment < _date)
                        {
                            _date = _commitment;
                        }
                    }
                    double dblQuantity = 0.00;
                    double.TryParse(drAnswer["quantity"].ToString(), out dblQuantity);
                    int intClass = 0;
                    if (Int32.TryParse(drAnswer["classid"].ToString(), out intClass) == true && oClass.IsProd(intClass))
                    {
                        double dblRecovery = 0.00;
                        double.TryParse(drAnswer["quantity"].ToString(), out dblRecovery);
                        dblQuantity += dblRecovery;
                    }
                    dblCount1 += dblQuantity;
                }
                //dblCount2 += dblCount1;
                if (_date == DateTime.MaxValue)
                {
                    dr["implementation"] = "N / A";
                }
                else
                {
                    dr["implementation"] = _date.ToShortDateString();
                }
                dr["quantity"] = dblCount1.ToString();
                dblCount1      = 0.00;
            }



            if (_start > ds.Tables[0].Rows.Count)
            {
                _start = 0;
            }
            intRecordStart = _start + 1;
            DataView dv = ds.Tables[0].DefaultView;

            if (Request.QueryString["sort"] != null)
            {
                dv.Sort = Request.QueryString["sort"];
            }
            dv.RowFilter = LoadFilter();
            LoadLists(dv);
            int intCount = _start + intRecords;

            if (dv.Count < intCount)
            {
                intCount = dv.Count;
            }
            int ii = 0;

            lblRecords.Text = "Models " + intRecordStart.ToString() + " - " + intCount.ToString() + " of " + dv.Count.ToString();
            for (ii = 0; ii < _start && ii < intCount; ii++)
            {
                dv[0].Delete();
            }
            int intTotalCount = (dv.Count - intRecords);

            for (ii = 0; ii < intTotalCount; ii++)
            {
                dv[intRecords].Delete();
            }
            rptView.DataSource = dv;
            rptView.DataBind();
            Projects        oProject        = new Projects(intProfile, dsn);
            Requests        oRequest        = new Requests(intProfile, dsn);
            ProjectsPending oProjectPending = new ProjectsPending(intProfile, dsn, intEnvironment);
            Users           oUser           = new Users(intProfile, dsn);
            StatusLevels    oStatusLevel    = new StatusLevels();

            lblNone.Visible = (rptView.Items.Count == 0);
            _start++;
        }
示例#24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            AuthenticateUser();
            if (Request.Cookies["profileid"] != null && Request.Cookies["profileid"].Value != "")
            {
                intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
            }
            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);
            }
            oDataPoint       = new DataPoint(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oService         = new Services(intProfile, dsn);
            oServiceDetail   = new ServiceDetails(intProfile, dsn);
            oServiceRequest  = new ServiceRequests(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);
            oStatusLevel     = new StatusLevels();
            oProjectNumber   = new ProjectNumber(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oLog             = new Log(intProfile, dsn);
            if (oUser.IsAdmin(intProfile) == true || (oDataPoint.GetPagePermission(intApplication, "SERVICE") == true || intDataPointAvailableService == 1))
            {
                panAllow.Visible = true;
                if (Request.QueryString["save"] != null)
                {
                    panSave.Visible = true;
                }
                if (Request.QueryString["clear"] != null)
                {
                    panClear.Visible = true;
                }
                if (Request.QueryString["error"] != null)
                {
                    panError.Visible = true;
                }
                if (Request.QueryString["close"] != null)
                {
                    Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "close", "<script type=\"text/javascript\">window.close();<" + "/" + "script>");
                }
                else if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
                {
                    string strID = oFunction.decryptQueryString(Request.QueryString["id"]);
                    intResource = Int32.Parse(strID);
                    DataSet ds = oDataPoint.GetServiceRequestResource(intResource);
                    if (ds.Tables[0].Rows.Count == 1)
                    {
                        // Load General Information

                        //string strHeader = intResource.ToString();
                        string strHeader = ds.Tables[0].Rows[0]["requestid"].ToString()
                                           + "-" + (ds.Tables[0].Rows[0]["ServiceId"] != DBNull.Value?ds.Tables[0].Rows[0]["ServiceId"].ToString():"0")
                                           + "-" + (ds.Tables[0].Rows[0]["number"] != DBNull.Value ? ds.Tables[0].Rows[0]["number"].ToString() : "0");

                        lblRequestID.Text    = strHeader;
                        lblRequestID.ToolTip = "Resource Request :" + intResource.ToString();

                        lblHeader.Text    = "&quot;" + strHeader + "&quot;";
                        Master.Page.Title = "DataPoint | Request (" + strHeader + ")";
                        lblHeaderSub.Text = "Provides all the information about a resource request...";
                        int intMenuTab = 0;
                        if (Request.QueryString["menu_tab"] != null && Request.QueryString["menu_tab"] != "")
                        {
                            intMenuTab = Int32.Parse(Request.QueryString["menu_tab"]);
                        }
                        Tab oTab = new Tab(hdnTab.ClientID, intMenuTab, "divMenu1", true, false);

                        oTab.AddTab("Submitted Information", "");
                        oTab.AddTab("Workflow / History", "");
                        oTab.AddTab("Resource(s) Involvement", "");
                        if (oUser.IsAdmin(intProfile) == true)
                        {
                            trAdmin.Visible = true;
                            Variables oVariable = new Variables(intEnvironment);
                            txtUser.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divUser.ClientID + "','" + lstUser.ClientID + "','" + hdnUser.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
                            lstUser.Attributes.Add("ondblclick", "AJAXClickRow();");
                            oTab.AddTab("Resource Detail", "");
                            divDetail.Visible = true;
                        }

                        if (!IsPostBack)
                        {
                            strOriginal = oResourceRequest.GetSummary(intResource, 0, intEnvironment, dsnServiceEditor, dsnAsset, dsnIP);

                            bool boolDeleted = (ds.Tables[0].Rows[0]["deleted"].ToString() != "0");
                            panDeleted.Visible = boolDeleted;
                            int intRequest   = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                            int intRequestor = oRequest.GetUser(intRequest);
                            strRequestor = "<a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"OpenWindow('PROFILE','?userid=" + intRequestor.ToString() + "');\">" + oUser.GetFullName(intRequestor) + " [" + oUser.GetName(intRequestor) + "]</a>";
                            int intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                            int intApp     = oRequestItem.GetItemApplication(intItem);
                            int intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                            int intNumber  = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                            // General Information
                            oDataPoint.LoadTextBox(txtRequest, intProfile, null, "/datapoint/service/request.aspx?t=id&q=" + oFunction.encryptQueryString("CVT" + intRequest.ToString()) + "&id=" + oFunction.encryptQueryString(intRequest.ToString()), lblRequest, fldRequest, "RESOURCE_REQUEST", "CVT" + ds.Tables[0].Rows[0]["requestid"].ToString(), "", true, false);
                            oDataPoint.LoadTextBox(txtCreated, intProfile, null, "", lblCreated, fldCreated, "RESOURCE_CREATED", ds.Tables[0].Rows[0]["created"].ToString(), "", true, false);
                            oDataPoint.LoadTextBox(txtDepartment, intProfile, null, "", lblDepartment, fldDepartment, "RESOURCE_DEPARTMENT", ds.Tables[0].Rows[0]["department"].ToString(), "", true, false);
                            oDataPoint.LoadTextBox(txtService, intProfile, null, "", lblService, fldService, "RESOURCE_SERVICE", oService.GetName(intService), "", true, false);
                            string  strOwner = "";
                            DataSet dsOwner  = oService.GetUser(intService, -1); // Service Owners
                            foreach (DataRow drOwner in dsOwner.Tables[0].Rows)
                            {
                                if (strOwner != "")
                                {
                                    strOwner += ", ";
                                }
                                int intOwner = Int32.Parse(drOwner["userid"].ToString());
                                strOwner += "<span class=\"required\">*</span> <a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"OpenWindow('PROFILE','?userid=" + intOwner.ToString() + "');\">" + oUser.GetFullName(intOwner) + " [" + oUser.GetName(intOwner) + "]</a>";
                            }
                            //strOwner = "<b>" + strOwner + "</b>";
                            DataSet dsManager = oService.GetUser(intService, 1);  // Managers
                            foreach (DataRow drManager in dsManager.Tables[0].Rows)
                            {
                                if (strOwner != "")
                                {
                                    strOwner += ", ";
                                }
                                int intManager = Int32.Parse(drManager["userid"].ToString());
                                strOwner += "<a href=\"javascript:void(0);\" class=\"lookup\" onclick=\"OpenWindow('PROFILE','?userid=" + intManager.ToString() + "');\">" + oUser.GetFullName(intManager) + " [" + oUser.GetName(intManager) + "]</a>";
                            }
                            oDataPoint.LoadTextBox(txtOwner, intProfile, null, "", lblOwner, fldOwner, "RESOURCE_OWNER", strOwner, "", true, false);
                            oDataPoint.LoadTextBox(txtName, intProfile, null, "", lblName, fldName, "RESOURCE_NAME", ds.Tables[0].Rows[0]["name"].ToString(), "", false, true);
                            oDataPoint.LoadTextBox(txtDevices, intProfile, null, "", lblDevices, fldDevices, "RESOURCE_DEVICES", ds.Tables[0].Rows[0]["devices"].ToString(), "", false, true);
                            oDataPoint.LoadTextBox(txtAllocated, intProfile, null, "", lblAllocated, fldAllocated, "RESOURCE_ALLOCATED", ds.Tables[0].Rows[0]["allocated"].ToString(), "", false, true);
                            if (txtDevices.Visible == true && oService.Get(intService, "disable_hours") != "1")
                            {
                                txtAllocated.Enabled = false;
                                txtAllocated.ToolTip = intService.ToString();
                                panDynamic.Visible   = true;
                            }
                            int intAccepted = Int32.Parse(ds.Tables[0].Rows[0]["accepted"].ToString());
                            oDataPoint.LoadDropDown(ddlAccepted, intProfile, null, "", lblAccepted, fldAccepted, "REQUEST_ACCEPTED", "name", "id", SqlHelper.ExecuteDataset(dsn, CommandType.Text, "SELECT -1 AS id, 'No' AS name UNION ALL SELECT 0 AS id, 'Pending' AS name UNION ALL SELECT 1 AS id, 'Yes' AS name"), intAccepted, false, false, true);
                            oDataPoint.LoadDropDown(ddlStatus, intProfile, null, "", lblStatus, fldStatus, "REQUEST_STATUS", "name", "id", SqlHelper.ExecuteDataset(dsn, CommandType.Text, oStatusLevel.List()), Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()), false, false, true);
                            oDataPoint.LoadTextBox(txtReason, intProfile, null, "", lblReason, fldReason, "RESOURCE_REASON", ds.Tables[0].Rows[0]["reason"].ToString(), "", false, false);
                            int intAssigned = Int32.Parse(ds.Tables[0].Rows[0]["assignedby"].ToString());
                            oDataPoint.LoadDropDownAJAX(txtAssignedBy, hdnAssignedBy, divAssignedBy, lstAssignedBy, intEnvironment, intProfile, null, "", lblAssignedBy, fldAssignedBy, "RESOURCE_ASSIGNED", intAssigned, (intAssigned > 0 ? oUser.GetFullName(intAssigned) + " (" + oUser.GetName(intAssigned) + ")" : ""), "/frame/users.aspx", "", false, false);
                            oDataPoint.LoadTextBox(txtAssignedOn, intProfile, null, "", lblAssignedOn, fldAssignedOn, "RESOURCE_ASSIGNED", ds.Tables[0].Rows[0]["assigned"].ToString(), "", true, false);
                            btnAssign.Visible = oUser.IsAdmin(intProfile);
                            btnAssign.Enabled = (intAssigned > 0);

                            ucWorkflow.RequestID = intRequest;
                            ucWorkflow.ServiceID = intService;
                            ucWorkflow.Number    = intNumber;

                            ucResourceInvolvement.ResourceRequestId = intResource;
                            //if (ds.Tables[1].Rows.Count > 0)
                            //{
                            //    // Resource Assignment(s)
                            //    if (ds.Tables[2].Rows.Count > 0)
                            //        ds.Relations.Add("relationship", ds.Tables[1].Columns["id"], ds.Tables[2].Columns["id"]);
                            //    rptAssignments.DataSource = ds.Tables[1];
                            //    rptAssignments.DataBind();
                            //    foreach (RepeaterItem ri in rptAssignments.Items)
                            //    {
                            //        Label lblStatusR = (Label)ri.FindControl("lblStatusR");
                            //        int intStatus = Int32.Parse(lblStatusR.Text);
                            //        lblStatusR.Text = oStatusLevel.HTML(intStatus);
                            //        Label lblProgress = (Label)ri.FindControl("lblProgress");
                            //        double dblProgress = double.Parse(lblProgress.Text);
                            //        if (intStatus == 3)
                            //            dblProgress = 100.00;
                            //        if (intStatus < 1 || intStatus > 2)
                            //            lblProgress.Text = "---";
                            //        else
                            //        {
                            //            try
                            //            {
                            //                lblProgress.Text = oServiceRequest.GetStatusBar(dblProgress, "100", "12", true);
                            //            }
                            //            catch
                            //            {
                            //                lblProgress.Text = oServiceRequest.GetStatusBar(0.00, "100", "12", true);
                            //            }
                            //        }

                            //        Panel panDelete = (Panel)ri.FindControl("panDelete");
                            //        if (panDelete.ToolTip == "1")
                            //            panDelete.Visible = true;
                            //        else
                            //        {
                            //            Panel panEdit = (Panel)ri.FindControl("panEdit");
                            //            panEdit.Visible = true;
                            //            Button btnLogin = (Button)ri.FindControl("btnLogin");
                            //            btnLogin.Attributes.Add("onclick", "return OpenNewWindowMenu('/frame/resource_request.aspx?rrid=" + btnLogin.CommandArgument + "', '800', '600');");
                            //            Button btnEdit = (Button)ri.FindControl("btnEdit");
                            //            if (oUser.IsAdmin(intProfile) || oService.IsManager(intService, intProfile))
                            //                btnEdit.Attributes.Add("onclick", "return OpenNewWindowMenu('/datapoint/service/manager.aspx?id=" + btnEdit.CommandArgument + "', '800', '600');");
                            //            else
                            //                btnEdit.Enabled = false;
                            //            LinkButton btnMore = (LinkButton)ri.FindControl("btnMore");
                            //            btnMore.Attributes.Add("onclick", "ShowHideDiv2('div_" + btnMore.CommandArgument + "');return false;");
                            //            if (ds.Tables[2].Rows.Count > 0)
                            //                btnMore.Visible = true;
                            //        }
                            //    }
                            //}
                            //lblAssignments.Visible = (rptAssignments.Items.Count == 0);


                            // This should be the last tab to load
                            DataSet dsResults = oRequest.GetResult(intRequest, intItem, intNumber);
                            if (dsResults.Tables[0].Rows.Count > 0)
                            {
                                // Request Results
                                oTab.AddTab("Request Results", "");
                                divResults.Visible    = true;
                                rptResults.DataSource = dsResults;
                                rptResults.DataBind();
                            }
                            lblResults.Visible = (rptResults.Items.Count == 0);

                            strMenuTab1 = oTab.GetTabs();
                        }
                    }
                    else
                    {
                        Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "close", "<script type=\"text/javascript\">window.close();<" + "/" + "script>");
                    }
                }
                else
                {
                    Response.Redirect("/datapoint/service/datapoint_service_search.aspx");
                }
                btnAssign.Attributes.Add("onclick", "return confirm('Are you sure you want to put this request back in queue for assignment?');");
                btnClose.Attributes.Add("onclick", "window.close();return false;");
                btnPrint.Attributes.Add("onclick", "window.print();return false;");
                btnSave.Attributes.Add("onclick", oDataPoint.LoadValidation());
                btnSaveClose.Attributes.Add("onclick", oDataPoint.LoadValidation());
            }
            else
            {
                panDenied.Visible = true;
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            intProfile       = Int32.Parse(Request.Cookies["profileid"].Value);
            oProjectRequest  = new ProjectRequest(intProfile, dsn);
            oResourceRequest = new ResourceRequest(intProfile, dsn);
            oProjectNumber   = new ProjectNumber(intProfile, dsn);
            oPage            = new Pages(intProfile, dsn);
            oUser            = new Users(intProfile, dsn);
            oRequestItem     = new RequestItems(intProfile, dsn);
            oApplication     = new Applications(intProfile, dsn);
            oRequest         = new Requests(intProfile, dsn);
            oVariable        = new Variables(intEnvironment);
            oService         = new Services(intProfile, dsn);
            oDelegate        = new Delegates(intProfile, dsn);
            oStatusLevel     = new StatusLevels();
            oEnhancement     = new Enhancements(intProfile, dsn);
            oLog             = new Log(intProfile, dsn);
            oFunction        = new Functions(intProfile, dsn, intEnvironment);

            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 (!IsPostBack)
                {
                    if (Request.QueryString["rrid"] != null && Request.QueryString["rrid"] != "")
                    {
                        lblResourceParent.Text = Request.QueryString["rrid"];
                        int intResourceParent = Int32.Parse(lblResourceParent.Text);
                        ds = oResourceRequest.Get(intResourceParent);
                        if (ds.Tables[0].Rows.Count > 0)
                        {
                            int      intItem    = Int32.Parse(ds.Tables[0].Rows[0]["itemid"].ToString());
                            int      intService = Int32.Parse(ds.Tables[0].Rows[0]["serviceid"].ToString());
                            int      intNumber  = Int32.Parse(ds.Tables[0].Rows[0]["number"].ToString());
                            int      intRequest = Int32.Parse(ds.Tables[0].Rows[0]["requestid"].ToString());
                            Forecast oForecast  = new Forecast(intProfile, dsn);
                            if (intService == intStorageService)
                            {
                                try
                                {
                                    OnDemandTasks oOnDemandTask = new OnDemandTasks(0, dsn);
                                    Locations     oLocation     = new Locations(0, dsn);
                                    DataSet       dsDesign      = oOnDemandTask.GetServerStorage(intRequest, intItem, intNumber);
                                    if (dsDesign.Tables[0].Rows.Count == 1)
                                    {
                                        int intAnswer  = Int32.Parse(dsDesign.Tables[0].Rows[0]["answerid"].ToString());
                                        int intAddress = Int32.Parse(oForecast.GetAnswer(intAnswer, "addressid"));
                                        lblLocation.Text    = oLocation.GetFull(intAddress);
                                        panLocation.Visible = true;
                                    }
                                }
                                catch { }
                            }
                            int     intProject  = Int32.Parse(oRequest.Get(intRequest, "projectid"));
                            int     intApp      = oRequestItem.GetItemApplication(intItem);
                            int     intForecast = 0;
                            DataSet dsForecast  = oForecast.GetProject(intProject);
                            if (dsForecast.Tables[0].Rows.Count > 0)
                            {
                                intForecast = Int32.Parse(dsForecast.Tables[0].Rows[0]["id"].ToString());
                            }
                            if (intForecast > 0)
                            {
                                btnView.Attributes.Add("oncontextmenu", "return OpenWindow('NEW_WINDOW','" + oPage.GetFullLink(intDesignBuilder) + "?id=" + intForecast.ToString() + "');");
                            }
                            else
                            {
                                btnView.Attributes.Add("oncontextmenu", "alert('There is no design for this project');return false;");
                            }
                            if (ds.Tables[0].Rows[0]["solo"].ToString() == "0")
                            {
                                btnView.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewRequest.ToString() + "&rid=" + intRequest.ToString() + "');");
                                btnView.Text = "Click here to view the project details";
                                lblType.Text = "Project Request";
                            }
                            else
                            {
                                btnView.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intViewResourceRequest.ToString() + "&rrid=" + intResourceParent.ToString() + "');");
                                if (oApplication.Get(intApp, "tpm") == "1")
                                {
                                    btnView.Text = "Click here to view the project details";
                                }
                                else
                                {
                                    btnView.Text = "Click here to view this request";
                                }
                                lblType.Text = "Service Request";
                            }
                            btnAssignments.Attributes.Add("onclick", "return OpenWindow('PRINTER_FRIENDLY','?page=" + intSearchPage.ToString() + "&pid=" + intProject + "&aid=" + intApp.ToString() + "&sort=userid');");
                            //btnAssignments.Attributes.Add("onclick", "return OpenNewWindowMenu('/datapoint/projects/datapoint_projects.aspx?id=" + oFunction.encryptQueryString(intProject.ToString()) + "', '800', '600');");
                            lblItem.Text    = intItem.ToString();
                            lblService.Text = oService.GetName(intService);
                            if (oApplication.Get(intApp, "request_items") == "1")
                            {
                                lblGroup.Text = oApplication.GetName(intApp) + " | " + oRequestItem.GetItemName(intItem);
                            }
                            else
                            {
                                lblGroup.Text = oApplication.GetName(intApp);
                            }
                            int intUser       = Int32.Parse(oRequest.Get(intRequest, "userid"));
                            int intAppManager = oApplication.GetManager(intApp);
                            if (ds.Tables[0].Rows[0]["accepted"].ToString() == "-1" && oApplication.Get(intApp, "tpm") == "1")
                            {
                                if (intUser == intProfile || oDelegate.Get(intUser, intProfile) > 0)
                                {
                                    panRequest.Visible      = true;
                                    panAssignSingle.Visible = true;
                                    txtHours.Text           = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    panHours.Visible        = !(oApplication.Get(intApp, "tpm") == "1");
                                    txtHours.Enabled        = (oService.Get(intService, "disable_hours") == "1" ? false : true);
                                    lblQuantity.Text        = ds.Tables[0].Rows[0]["devices"].ToString();
                                    lblStatus.Text          = oStatusLevel.HTML(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()));
                                    panQuantity.Visible     = (lblQuantity.Text != "0");
                                    txtQuantity.Text        = lblQuantity.Text;
                                    txtQuantity.Enabled     = (txtQuantity.Text != "0");
                                    txtQuantity.Enabled     = false;
                                    lblAssign.Text          = oUser.GetFullName(intProfile);
                                    strSummary = oResourceRequest.GetBodyOverallFix(intResourceParent, 0, intEnvironment, false);
                                }
                                else
                                {
                                    Response.Write("no rights");
                                    panDenied.Visible = true;
                                }
                                btnSubmit.Attributes.Add("onclick", "return ValidateNumber0('" + txtHours.ClientID + "','Please enter a valid number for the hours allocated') && ValidateHidden('" + hdnManager.ClientID + "','" + txtManager.ClientID + "','Please enter a valid LAN ID') && ProcessButton(this);");
                            }
                            else
                            {
                                string strValidate = "";
                                if (oUser.IsAdmin(intProfile) || oService.IsManager(intService, intProfile) || (oApplication.IsManager(intApp, intProfile) && oApplication.Get(intApp, "disable_manager") != "1"))
                                {
                                    panRequest.Visible        = true;
                                    panAssignMultiple.Visible = true;
                                    btnSubmit.Enabled         = (ds.Tables[0].Rows[0]["assigned"].ToString() == "");
                                    if (ds.Tables[0].Rows[0]["status"].ToString() == "5")
                                    {
                                        radHold.Checked            = true;
                                        divChoice.Style["display"] = "inline";
                                        divHold.Style["display"]   = "inline";
                                        txtHold.Text = ds.Tables[0].Rows[0]["reason"].ToString();
                                    }
                                    else
                                    {
                                        divChoice.Style["display"] = (ds.Tables[0].Rows[0]["accepted"].ToString() == "0" ? "inline" : "none");
                                        divAccept.Style["display"] = (ds.Tables[0].Rows[0]["accepted"].ToString() == "1" ? "inline" : "none");
                                    }
                                    int intEnhancementService = 0;
                                    Int32.TryParse(ConfigurationManager.AppSettings["HELP_ENHANCEMENT_SERVICEID"], out intEnhancementService);
                                    if (intService == intEnhancementService)
                                    {
                                        panEnhancement.Visible   = true;
                                        ddlModule.DataTextField  = "name";
                                        ddlModule.DataValueField = "id";
                                        ddlModule.DataSource     = oEnhancement.GetModules(1);
                                        ddlModule.DataBind();
                                        ddlModule.Items.Insert(0, new ListItem("-- SELECT --", "0"));

                                        strValidate += "ValidateDropDown('" + ddlModule.ClientID + "','Select a classification') && ";
                                        radEnhancementShort.Checked = true;
                                        radEnhancementReject.Attributes.Add("onclick", "ShowHideDiv('" + trEnhancementReject.ClientID + "','inline');ShowHideDiv('" + trEnhancementClassification.ClientID + "','none');ShowHideDiv('" + divAccept.ClientID + "','none');");
                                        radEnhancementDuplicate.Attributes.Add("onclick", "ShowHideDiv('" + trEnhancementReject.ClientID + "','inline');ShowHideDiv('" + trEnhancementClassification.ClientID + "','none');ShowHideDiv('" + divAccept.ClientID + "','none');");
                                        radEnhancementShort.Attributes.Add("onclick", "ShowHideDiv('" + trEnhancementReject.ClientID + "','none');ShowHideDiv('" + trEnhancementClassification.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','inline');");
                                        radEnhancementLong.Attributes.Add("onclick", "ShowHideDiv('" + trEnhancementReject.ClientID + "','inline');ShowHideDiv('" + trEnhancementClassification.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','inline');");
                                    }
                                    panDelete.Visible = (intItem == intImplementorDistributed || intItem == intImplementorMidrange);
                                    btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this request');");
                                    txtHours.Text       = double.Parse(ds.Tables[0].Rows[0]["allocated"].ToString()).ToString("F");
                                    panHours.Visible    = !(oApplication.Get(intApp, "tpm") == "1");
                                    txtHours.Enabled    = (oService.Get(intService, "disable_hours") == "1" ? false : true);
                                    lblQuantity.Text    = ds.Tables[0].Rows[0]["devices"].ToString();
                                    panQuantity.Visible = (lblQuantity.Text != "0");
                                    txtQuantity.Text    = lblQuantity.Text;
                                    txtQuantity.Enabled = (txtQuantity.Text != "0");
                                    txtQuantity.Enabled = false;
                                    lblStatus.Text      = oStatusLevel.HTML(Int32.Parse(ds.Tables[0].Rows[0]["status"].ToString()));
                                    trAssigned.Visible  = !(btnSubmit.Enabled);
                                    string  strAssign = "";
                                    DataSet dsManager = oService.GetUser(intService, 1);
                                    foreach (DataRow drManager in dsManager.Tables[0].Rows)
                                    {
                                        if (strAssign != "")
                                        {
                                            strAssign += ", ";
                                        }
                                        strAssign += oUser.GetFullName(Int32.Parse(drManager["userid"].ToString()));
                                    }
                                    lblAssign.Text = strAssign;
                                    DataSet   dsReports = oUser.GetManagerReports(intAppManager, intRequest, intService, intNumber);
                                    DataTable dtReports = dsReports.Tables[0].Copy();
                                    dtReports.Clear();
                                    DataSet dsAssignment = oService.GetUser(intService, -100);
                                    foreach (DataRow drAssignment in dsAssignment.Tables[0].Rows)
                                    {
                                        int     intAssignment = Int32.Parse(drAssignment["userid"].ToString());
                                        DataSet dsAssignees   = oUser.GetManagerReports(intAssignment, intRequest, intService, intNumber);
                                        foreach (DataRow drAssignee in dsAssignees.Tables[0].Rows)
                                        {
                                            dtReports.ImportRow(drAssignee);
                                        }
                                    }
                                    if (dtReports.Rows.Count > 0)
                                    {
                                        // Use custom assignment list
                                        // First, remove duplicates
                                        Hashtable hTable        = new Hashtable();
                                        ArrayList duplicateList = new ArrayList();
                                        foreach (DataRow drow in dtReports.Rows)
                                        {
                                            if (hTable.Contains(drow["userid"]))
                                            {
                                                duplicateList.Add(drow);
                                            }
                                            else
                                            {
                                                hTable.Add(drow["userid"], string.Empty);
                                            }
                                        }
                                        foreach (DataRow dRow in duplicateList)
                                        {
                                            dtReports.Rows.Remove(dRow);
                                        }

                                        // Next, sort by username
                                        dtReports.DefaultView.Sort = "username";

                                        // Now add to dataset
                                        dsReports = new DataSet();
                                        dsReports.Tables.Add(dtReports.DefaultView.ToTable());
                                    }
                                    LoadList(dsReports, intApp);
                                    LoadAvailable(dsReports, intApp);
                                    strSummary = oResourceRequest.GetBodyOverallFix(intResourceParent, 0, intEnvironment, false);
                                }
                                else
                                {
                                    Response.Write("no delegate");
                                    panDenied.Visible = true;
                                }
                                btnSubmit.Attributes.Add("onclick", "return " + strValidate + "ValidateChoice('" + divChoice.ClientID + "','" + radAccept.ClientID + "','" + radReject.ClientID + "','" + radHold.ClientID + "','" + ddlUser.ClientID + "','" + txtHours.ClientID + "') && ProcessButton(this);");
                            }
                        }
                        else
                        {
                            panDenied.Visible = true;
                        }
                    }
                    else
                    {
                        panDenied.Visible = true;
                    }
                }
            }
            btnClose.Attributes.Add("onclick", "return CloseWindow();");
            lnkAvailable.Attributes.Add("onclick", "return ShowHideAvailable('" + divAvailable.ClientID + "');");
            radAccept.Attributes.Add("onclick", "ShowHideDiv('" + divAccept.ClientID + "','inline');ShowHideDiv('" + divReject.ClientID + "','none');ShowHideDiv('" + divHold.ClientID + "','none');");
            radReject.Attributes.Add("onclick", "ShowHideDiv('" + divReject.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','none');ShowHideDiv('" + divHold.ClientID + "','none');");
            radHold.Attributes.Add("onclick", "ShowHideDiv('" + divHold.ClientID + "','inline');ShowHideDiv('" + divAccept.ClientID + "','none');ShowHideDiv('" + divReject.ClientID + "','none');");
            txtManager.Attributes.Add("onkeyup", "return AJAXTextBoxGet(this,'300','195','" + divManager.ClientID + "','" + lstManager.ClientID + "','" + hdnManager.ClientID + "','" + oVariable.URL() + "/frame/users.aspx',2);");
            lstManager.Attributes.Add("ondblclick", "AJAXClickRow();");
        }
示例#26
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?');");
        }