Ejemplo n.º 1
0
        private void BindPage(int fileId)
        {
            BLL.Loans bllLoans = new BLL.Loans();

            Model.Loans  modelLoan  = new Model.Loans();
            BLL.Contacts bllContact = new BLL.Contacts();
            BLL.Users    bllUser    = new BLL.Users();

            modelLoan = bllLoans.GetModel(fileId);
            if (modelLoan != null && modelLoan.RateLockExpiration != null)
            {
                lblRateLockExp.Text = modelLoan.RateLockExpiration.Value.ToShortDateString();
                hfdExpDate.Value    = modelLoan.RateLockExpiration.Value.ToOADate().ToString();
            }

            lblCurrentState.Text = bllLoans.GetLoanStage(fileId);

            lblBorrower.Text = bllContact.GetBorrower(fileId);

            if (modelLoan != null)
            {
                lblEstCloseDate.Text = modelLoan.EstCloseDate != null?modelLoan.EstCloseDate.Value.ToShortDateString() : string.Empty;
            }

            lblCoborrower.Text = bllContact.GetCoBorrower(fileId);

            lblLoanOfficer.Text = bllUser.GetLoanOfficer(fileId);

            if (modelLoan != null)
            {
                lblPropertyAddress.Text = modelLoan.PropertyAddr + " " + modelLoan.PropertyCity + " " + modelLoan.PropertyState + " " + modelLoan.PropertyZip;
            }

            if (modelLoan != null && modelLoan.LoanAmount.HasValue)
            {
                lblLoanAmount.Text = "$" + string.Format("{0:N0}", modelLoan.LoanAmount.Value);
            }

            if (modelLoan != null && modelLoan.Rate.HasValue)
            {
                lblInterestRate.Text = modelLoan.Rate.Value.ToString("#.####") + "%";
            }

            lblLender.Text = bllLoans.GetLender(fileId);

            hfdFileId.Value = fileId.ToString();
        }
Ejemplo n.º 2
0
        private void BindPage(int fileId, int hisId)
        {
            BLL.Loans              bllLoans              = new BLL.Loans();
            Model.Loans            modelLoan             = new Model.Loans();
            BLL.Contacts           bllContact            = new BLL.Contacts();
            BLL.Users              bllUser               = new BLL.Users();
            BLL.PointImportHistory bllPointImportHistory = new PointImportHistory();
            BLL.PointFiles         bllPointFiles         = new PointFiles();
            BLL.PointFolders       bllPointFolders       = new PointFolders();

            var dsList = new DataSet();

            if (fileId > 0)
            {
                dsList = bllPointImportHistory.GetList(string.Format("FileId={0}", fileId));
            }
            else if (hisId > 0)
            {
                dsList = bllPointImportHistory.GetList(string.Format("HistoryId={0}", hisId));
            }

            if (dsList == null || dsList.Tables.Count == 0 || dsList.Tables[0].Rows.Count == 0)
            {
                PageCommon.AlertMsg(this, "There is no data in database.");
                return;
            }

            fileId         = int.Parse(dsList.Tables[0].Rows[0]["FileId"].ToString());
            hfdHisId.Value = fileId.ToString();
            var modelPointFiles = bllPointFiles.GetModel(fileId);

            if (modelPointFiles != null)
            {
                var modelPointFolder = bllPointFolders.GetModel(modelPointFiles.FolderId);
                if (modelPointFolder != null)
                {
                    lblPointFile.Text = modelPointFolder.Name + modelPointFiles.Name;
                }
            }

            lblBorrower.Text    = bllContact.GetBorrower(fileId);
            lblLoanOfficer.Text = bllUser.GetLoanOfficer(fileId);



            // Start: get icon name by fileId, 2010-11-15
            if (string.IsNullOrEmpty(imgSrc))
            {
                string strSeverity = dsList.Tables[0].Rows[0]["Severity"].ToString().ToLower();
                switch (strSeverity)
                {
                case "error":
                    imgIcon.Src = "../images/loan/AlertError.png";
                    break;

                case "warning":
                    imgIcon.Src = "../images/loan/AlertWarning.png";
                    break;

                default:
                    imgIcon.Visible = false;
                    break;
                }
            }
            else
            {
                imgIcon.Src = "../images/loan/" + imgSrc;
            }
            // End: get icon name by fileId, 2010-11-15

            DateTime dt = DateTime.MinValue;

            DateTime.TryParse(dsList.Tables[0].Rows[0]["ImportTime"].ToString(), out dt);

            if (dt != DateTime.MinValue)
            {
                lblTime.Text = dt.ToString("MM/dd/yyyy hh:mm:ss");
            }

            if (!string.IsNullOrEmpty(dsList.Tables[0].Rows[0]["Error"].ToString()))
            {
                string s1 = dsList.Tables[0].Rows[0]["Error"].ToString().Trim();
                s1 = s1.Replace("<br/>  ", "\r\n");
                s1 = s1.Replace("<br/> ", "\r\n");
                s1 = s1.Replace("<br/>", "\r\n");
                tbxErrorMessages.Text = s1;
            }
        }