Esempio n. 1
0
        private void LoadLineNumDetails(LineNum line_item, bool EnableForUpdate, bool IsArchived)
        {
            lblLineNum.Text = line_item.LineNumID.ToString();

            lblReviewer.Text       = line_item.Reviewer;
            txtReviewerEmail.Value = Admin.GetEmailByUserID(line_item.ReviewerUserID);

            lblOrganization.Text = line_item.Organization;
            lblOrgCode.Text      = line_item.ULOOrgCode;

            if (IsArchived)
            {
                lblStatus.Text = line_item.Status + " (Archived)";
            }
            else
            {
                lblStatus.Text = line_item.StatusDescription;
            }

            //display Line ULOOrgCode only if it's different from Open Item ULOOrgCode:

            /*
             * if (lblOrgCode.Text != line_item.ULOOrgCode)
             * {
             *  lblLineOrgCode.Text = String.Format(" ({0})", line_item.ULOOrgCode);
             *  lblLineOrgCode.Visible = true;
             * }
             * else
             *  lblLineOrgCode.Visible = false;
             */

            lblValid.Text = line_item.ValidDescription;
            if (line_item.Valid == (int)OpenItemValidation.vlInvalid)
            {
                lblDeobligatedDate.Visible = true;
                lblDeobligatedInfo.Visible = true;
                lblDeobligatedDate.Text    = Utility.DisplayDateFormat(line_item.DeobligatedDate, "MMM dd, yyyy");
            }
            else
            {
                lblDeobligatedInfo.Visible = false;
                lblDeobligatedDate.Visible = false;
            }
            lblTotalLineLine.Text  = Utility.DisplayMoneyFormat(line_item.TotalLine);
            lblProjNum.Text        = line_item.ProjectNumber;
            lblBA.Text             = line_item.BA;
            txtRWA.Text            = line_item.RWA;
            lblAGRE_BLDG.Text      = line_item.AGRE_BLDG;
            lblBuilding.Text       = line_item.Building;
            lblVendCD.Text         = line_item.VendorCD;
            lblVendName.Text       = line_item.VendorName;
            lblACTG_PD.Text        = Utility.DisplayDateFormat(line_item.ACTG_PD, "MMM dd, yyyy");
            lblLastPaidLine.Text   = Utility.DisplayDateFormat(line_item.LastPaid, "MMM dd, yyyy");
            lblBBFY.Text           = line_item.BBFY.ToString();
            lblEBFY.Text           = line_item.EBFY.ToString();
            lblUDOLine.Text        = Utility.DisplayMoneyFormat(line_item.UDO);
            lblFC.Text             = line_item.FC;
            lblOC.Text             = line_item.OC.ToString();
            lblCE.Text             = line_item.CE.ToString();
            lblACCRLine.Text       = Utility.DisplayMoneyFormat(line_item.ACCR);
            lblPENDPYMTLine.Text   = Utility.DisplayMoneyFormat(line_item.PEND_PYMT);
            lblPYMTS_CONFLine.Text = Utility.DisplayMoneyFormat(line_item.PYMTS_CONF);
            lblHOLDBACKSLine.Text  = Utility.DisplayMoneyFormat(line_item.HOLDBACKS);

            txtComment.Text = line_item.Comments;

            if (line_item.LineInfo.Length > 0)
            {
                txtLineInfo.Text    = line_item.LineInfo;
                txtLineInfo.Enabled = false;

                tblLineInfo.Visible = true;
            }
            else
            {
                tblLineInfo.Visible = false;
            }


            ddlCode.SelectedValue = line_item.Code;
            txtCodeComment.Text   = line_item.CodeComments;
            if (line_item.Code != "")
            {
                var drCode = dtCodeList.Select("Code = '" + line_item.Code + "'");
                if (drCode.Length > 0)
                {
                    lblCode.Text = drCode[0]["Code"].ToString();
                }
            }

            ddlValid.SelectedValue = line_item.Valid.ToString();

            //display Justification Value:
            var justifications = Lookups.GetJustificationValues();
            var justification  = justifications.Where(j => j.Justification == line_item.JustificationCode);

            if (justification.Any())
            {
                var firstJustification = justification.First();
                if (firstJustification.InDefaultList)
                {
                    rblJustification.SelectedValue = line_item.JustificationCode.ToString();
                    if (firstJustification.DisplayAddOnField)
                    {
                        lblJustificationExplanation.Text = (string)Utility.GetNotNullValue(firstJustification.AddOnDescription, "String");
                        txtAddJustification.Text         = line_item.JustificationAddOn;
                    }
                    else
                    {
                        lblJustificationExplanation.AddVisibilityHidden();
                        txtAddJustification.AddVisibilityHidden();
                        lblJustAddInfo.AddVisibilityHidden();
                    }
                    txtJustOther.AddVisibilityHidden();
                    lblJustOther.AddVisibilityHidden();
                }
                else
                {
                    rblJustification.SelectedValue = "6";
                    lblJustificationExplanation.AddVisibilityHidden();
                    txtAddJustification.AddVisibilityHidden();
                    txtJustOther.Text = (string)Utility.GetNotNullValue(firstJustification.JustificationDescription, "String");
                }
            }
            else
            {
                lblJustificationExplanation.AddVisibilityHidden();
                txtAddJustification.AddVisibilityHidden();
                lblJustAddInfo.AddVisibilityHidden();
                txtJustOther.AddVisibilityHidden();
                lblJustOther.AddVisibilityHidden();
            }

            var sb = new StringBuilder();

            sb.Append("<script type='text/javascript' >");
            sb.Append("var original_selected_just = '");
            sb.Append(rblJustification.SelectedValue);
            sb.Append("';");
            sb.Append("var original_add_on = '");
            sb.Append(txtAddJustification.Text);
            sb.Append("';");
            sb.Append("</script>");
            Page.RegisterStartupScript("orig_just", sb.ToString());


            if (!EnableForUpdate)
            {
                txtRWA.Enabled              = false;
                txtComment.Enabled          = false;
                ddlValid.Enabled            = false;
                ddlCode.Enabled             = false;
                txtCodeComment.Enabled      = false;
                rblJustification.Enabled    = false;
                txtAddJustification.Enabled = false;
                txtJustOther.Enabled        = false;
            }
            else
            {
                //check if there are values for UDO & DO Should Be fields:
                var str_msg = "";
                if (lblCompletionDate.Text == "")
                {
                    str_msg = str_msg + "Expected Completion Date.<br />";
                }
                if (lblUDOShouldBe.Text.Trim() == "$" || lblUDOShouldBe.Text.Trim().Length == 0)
                {
                    str_msg = str_msg + "UDO Should Be.<br />";
                }
                if (lblDOShouldBe.Text.Trim() == "$" || lblDOShouldBe.Text.Trim().Length == 0)
                {
                    str_msg = str_msg + "DO Should Be.<br />";
                }

                if (str_msg.Length > 0)
                {
                    str_msg = "The following fields are required:<br />" + str_msg + "Please fill these fields before Line validation. <br/>";

                    lblMsgValidation.Visible    = true;
                    lblMsgValidation.Text       = str_msg;
                    ddlValid.Enabled            = false;
                    ddlCode.Enabled             = false;
                    txtCodeComment.Enabled      = false;
                    rblJustification.Enabled    = false;
                    txtAddJustification.Enabled = false;
                    txtJustOther.Enabled        = false;
                }
            }
        }
Esempio n. 2
0
        private void LoadItemDetails(OpenItem item)
        {
            //bool blnForUpdate = Item.AvailableForUpdate(item.IsArchived, (item.ParentLoadID > 0), item.Organization, item.ReviewerUserID, User, CurrentUserOrganization, CurrentUserID);

            lblReviewer.Text        = item.Reviewer;
            txtReviewerUserID.Value = item.ReviewerUserID.ToString();
            txtReviewerEmail.Value  = Admin.GetEmailByUserID(Convert.ToInt32(txtReviewerUserID.Value));

            lblDocNumber.Text = item.DocNumber;
            DocNumber         = item.DocNumber;

            txtItemStatusCode.Value = item.StatusCode.ToString();


            lblEstAccrual.Text    = item.EstimatedAccrual;
            lblTypeOfBalance.Text = item.TypeOfBalance;
            lblCategory.Text      = item.Category;
            lblACCR.Text          = Utility.DisplayMoneyFormat(item.ACCR);
            lblAcctPeriod.Text    = item.AcctPeriod;
            lblAwardNum.Text      = item.AwardNumber;
            lblDO.Text            = Utility.DisplayMoneyFormat(item.DO);
            lblEarliest.Text      = Utility.DisplayDateFormat(item.Earliest, "MM/yyyy");
            lblFirstReview.Text   = item.ReviewRoundDesc;
            lblHOLDBACKS.Text     = Utility.DisplayMoneyFormat(item.HOLDBACKS);
            lblJustification.Text = item.Justification;
            lblLatest.Text        = Utility.DisplayDateFormat(item.Latest, "MM/yyyy");
            lblOrganization.Text  = item.Organization;
            lblOrgCode.Text       = item.ULOOrgCode;
            lblPENDPYMT.Text      = Utility.DisplayMoneyFormat(item.PEND_PYMT);
            lblPYMTS_CONF.Text    = Utility.DisplayMoneyFormat(item.PYMT_CONF);
            lblTitleField.Text    = item.TitleField;
            lblTotalLine.Text     = Utility.DisplayMoneyFormat(item.TotalLine);
            lblUDO.Text           = Utility.DisplayMoneyFormat(item.UDO);

            lblLastPaid.Text = Utility.DisplayDateFormat(item.LastPaid, "MMM dd, yyyy");
            lblExpDate.Text  = Utility.DisplayDateFormat(item.ExpirationDate, "MMM dd, yyyy");

            lblDueDate.Text = Utility.DisplayDateFormat(item.DueDate, "MMM dd, yyyy");
            if (item.DueDate <= DateTime.Now && !item.IsArchived)
            {
                lblDueDate.CssClass = "regBldRedText";
            }

            if (item.IsArchived)
            {
                lblStatus.Text = item.Status + " (Archived)";
            }
            else
            {
                lblStatus.Text = item.Status;
            }

            if (item.ParentLoadID > 0)
            {
                lblValid.Text     = item.ValidDescription + " (1st review)";
                lblValid.CssClass = "regBldGreyText";
            }
            else
            {
                lblValid.Text = item.ValidDescription;
            }

            if (item.JustificationRequired)
            {
                lblJustfReq.Text = "Yes";
            }
            else
            {
                lblJustfReq.Text = "No";
            }

            txtComment.Text = item.Comments;
            txtDO.Text      = item.DOShouldBe;
            txtUDO.Text     = item.UDOShouldBe;

            dtCompletionDate.MinDate   = DateTime.Parse("01/01/1990");
            dtCompletionDate.MaxDate   = DateTime.Now.AddYears(10);
            dtCompletionDate.VoidEmpty = false;
            if (item.ExpectedCompletionDate > DateTime.MinValue)
            {
                dtCompletionDate.Date = item.ExpectedCompletionDate;
                if (item.ExpectedCompletionDate < DateTime.Now)
                {
                    dtCompletionDate.DateCSSClass = "regBldRedText";
                }
            }

            ctrlContacts.ContrOfficerByCO = item.ContrOfficerByCO;


            if (item.ItemInfo.Length > 0)
            {
                txtItemInfo.Text    = item.ItemInfo;
                txtItemInfo.Enabled = false;

                tblItemInfo.Visible = true;
            }
            else
            {
                tblItemInfo.Visible = false;
            }


            /*
             * //save current item properties on client:
             * StringBuilder sb = new StringBuilder();
             * sb.Append("<script type='text/javascript' >");
             * sb.Append("var init_udo = '" + txtUDO.Text + "';");
             * sb.Append("var init_do = '" + txtDO.Text + "';");
             * sb.Append("</script>");
             * ClientScript.RegisterClientScriptBlock(this.GetType(), "item_details", sb.ToString());
             */

            if (!BlnForUpdate)// not updates here
            {
                txtComment.Enabled          = false;
                txtDO.Enabled               = false;
                txtUDO.Enabled              = false;
                dtCompletionDate.FreezeMode = true;
                dtCompletionDate.VoidEdit   = true;

                btnSave.Enabled = false;
                btnSave.Visible = false;

                btnReviewer.Disabled     = true;
                btnReviewer.Visible      = false;
                btnReviewer0.Disabled    = true;
                btnReviewer0.Visible     = false;
                lblReassignLines.Visible = false;

                ctrlContacts.Enabled = false;
                ctrlAttachments.ShowAddAttBtn(false);
                ctrlAttachments.ShowEmailIcon(false, txtReviewerEmail.Value, lblDocNumber.Text);
            }
            else // here we can update the data
            {
                ctrlContacts.Enabled = true;
                ctrlAttachments.ShowAddAttBtn(true);

                if (lblValid.Text.ToLower().Trim() == "valid" || lblValid.Text.ToLower().Trim() == "invalid")
                {
                    ctrlAttachments.ShowEmailIcon(true, txtReviewerEmail.Value, lblDocNumber.Text);
                }
                else
                {
                    ctrlAttachments.ShowEmailIcon(false, txtReviewerEmail.Value, lblDocNumber.Text);
                }

                if (item.StatusCode == (int)OpenItemStatus.stReassignRequest)
                {
                    btnReviewer.Disabled     = true;
                    btnReviewer.Visible      = false;
                    lblReassignLines.Visible = false;
                }

                if (User.IsInRole(((int)UserRoles.urBudgetDivisionAdmin).ToString()))
                {
                    txtReassignTargetPage.Value = "Reroute";
                }
                else if (User.IsInRole(((int)UserRoles.urOrganizationAdmin).ToString()))
                {
                    txtReassignTargetPage.Value = "Reassign";
                }
                else
                {
                    txtReassignTargetPage.Value = "ReassignRequest";
                }
            }
        }