예제 #1
0
        private void UpdateTheRateExtendLock(int extendDays)
        {
            BLL.Company_Alerts bllComAlert = new Company_Alerts();
            BLL.LoanAlerts     bllAlert    = new LoanAlerts();
            BLL.Loans          bllLoans    = new BLL.Loans();
            Model.Loans        modelLoan   = new Model.Loans();

            modelLoan = bllLoans.GetModel(FileId);
            modelLoan.RateLockExpiration = OrgDate.AddDays(extendDays);

            bllLoans.Update(modelLoan);

            var comModel = bllComAlert.GetModel();
            //todo:确认此处是否这样查询LoanAlerts表中对应当前Loan的记录
            //此处应该只能查处一条数据
            var alertModelList = bllAlert.GetModelList(string.Format("FileId={0} AND AlertType={1}", FileId, "'Rate Lock'"));

            if (alertModelList.Count == 0)
            {
                return;
            }

            //if (extendDays < comModel.RateLockYellowDays || extendDays < comModel.RateLockRedDays)
            //{
            //    alertModelList[0].DueDate = OrgDate.AddDays(extendDays);
            //    bllAlert.Update(alertModelList[0]);
            //}
            //else if (extendDays > comModel.RateLockYellowDays || extendDays > comModel.RateLockRedDays)
            //{
            //    alertModelList[0].DueDate = OrgDate.AddDays(extendDays);
            //    bllAlert.Delete(alertModelList[0].LoanAlertId);
            //}

            PageCommon.WriteJs(this, "Update succeeded!", "window.parent.parent.location.href=window.parent.parent.location.href;parent.CloseCurrentWindowHandller();");
        }
예제 #2
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();
        }
예제 #3
0
        private void ExportLeads(string IDs)
        {
            try
            {
                BLL.Loans LoansManager = new BLL.Loans();
                DataTable dt           = new DataTable();

                int recordCount = 0;

                string strWhere = isAll == true ? queryCondition : " FileId in(" + IDs + ")";

                DataSet Lists = LoansManager.Lead_FirstPage_GetProspectListNew(recordTotal, 1, strWhere, out recordCount, "FileId", 0);
                if (recordCount > 0)
                {
                    dt = Lists.Tables[0];
                }

                List <string> ShowColumnsList   = ShowColumns();
                List <string> NoShowColumnsList = new List <string>();

                foreach (DataColumn item in dt.Columns)
                {
                    if (ShowColumnsList.Contains(item.ColumnName))
                    {
                        item.Caption = item.ColumnName;
                    }
                    else
                    {
                        NoShowColumnsList.Add(item.ColumnName);
                    }
                }

                foreach (string item in NoShowColumnsList)
                {
                    dt.Columns.Remove(dt.Columns[item]);
                }



                Common.XlsExporter.DownloadXls(this.Page, dt, "Leads Pipeline Report.xls", "Leads Pipeline Report");
            }
            catch (Exception ex)
            {
            }
        }
예제 #4
0
        protected void btnSel_Click(object sender, EventArgs e)
        {
            string sFolderID = "0";

            // return selected record as XML
            foreach (GridViewRow row in gvFolder.Rows)
            {
                CheckBox ckbSelected = row.FindControl("ckbSelected") as CheckBox;
                if (ckbSelected.Checked)
                {
                    if (!string.IsNullOrEmpty(_strPstatus) && _strPstatus == "1")
                    {
                        //ClientFun("callback", string.Format("callBack('{0}','{1}');", gvFolder.DataKeys[row.RowIndex].Value, _strPstatus));
                        sFolderID = gvFolder.DataKeys[row.RowIndex].Value.ToString();
                        //return;
                    }
                    //ClientFun("callback", string.Format("callBack('{0}');", gvFolder.DataKeys[row.RowIndex].Value.ToString()));
                    sFolderID = gvFolder.DataKeys[row.RowIndex].Value.ToString();
                    //return;
                }
            }

            BLL.Loans LoansManager = new BLL.Loans();

            string sProspectStatus = "";

            try
            {
                sProspectStatus = LoansManager.GetProspectStatusInfo(Convert.ToInt32(this.strFileId));
                string sFileName = LoansManager.GetProspectFileNameInfo(Convert.ToInt32(this.strFileId));  //bug 878
                if (sFileName == "")
                {
                    //PageCommon.AlertMsg(this, string.Format("The selected loan does not have a Point file. Please export the loan to a Point file using the Lead Detail page and try again."));
                    PageCommon.WriteJsEnd(this, "The selected loan does not have a Point file. Please export the loan to a Point file using the Lead Detail page and try again.", "window.parent.CloseGlobalPopup();");
                    return;
                }
            }
            catch
            {
                LPLog.LogMessage(LogType.Logerror, "Invalid loan status: " + sProspectStatus);
                return;
            }
            try
            {
                ServiceManager sm = new ServiceManager();
                using (LP2ServiceClient client = sm.StartServiceClient())
                {
                    MoveFileRequest req = new MoveFileRequest();
                    req.FileId = Convert.ToInt32(this.strFileId);
                    //           req.LoanStatus = lse;
                    req.NewFolderId = Convert.ToInt32(sFolderID);
                    req.hdr         = new ReqHdr();
                    req.hdr.UserId  = CurrUser.iUserID;
                    //           req.StatusDate = DateTime.Now;

                    MoveFileResponse response = client.MoveFile(req);
                    if (response.hdr.Successful)
                    {
                        PageCommon.WriteJsEnd(this, "", "window.parent.CloseGlobalPopup();");
                    }
                    else
                    {
                        LPLog.LogMessage(LogType.Logerror, string.Format("Failed to move file:{0}", response.hdr.StatusInfo));
                        //PageCommon.AlertMsg(this, response.hdr.StatusInfo);
                        //ClientFun("callback", "");
                        PageCommon.WriteJsEnd(this, response.hdr.StatusInfo, "window.parent.CloseGlobalPopup();");
                    }
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException ee)
            {
                LPLog.LogMessage(LogType.Logerror, string.Format("Faield to move file:{0}", ee.Message));
                //PageCommon.AlertMsg(this, "Failed to move the Point file, reason: Point Manager is not running.");
                //ClientFun("callback", "");
                PageCommon.WriteJsEnd(this, "Failed to move the Point file, reason: Point Manager is not running.", "window.parent.CloseGlobalPopup();");
            }
            catch (Exception ex)
            {
                LPLog.LogMessage(LogType.Logerror, string.Format("Faield to move file:{0}", ex.Message));
                PageCommon.WriteJsEnd(this, ex.Message, "window.parent.CloseGlobalPopup();");
            }
        }
예제 #5
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;
            }
        }