示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region 检查必要参数

        bool bIsValid = PageCommon.ValidateQueryString(this, "LoanID", QueryStringType.ID);
        if (bIsValid == false)
        {
            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "_Missing", "$('#divContainer').hide();alert('Missing required query string.');window.parent.CloseDialog_AddRule();", true);
            return;
        }

        this.iLoanID = Convert.ToInt32(this.Request.QueryString["LoanID"]);

        //Get rule num by loan id
        LPWeb.BLL.LoanRules loanRulesMgr = new LPWeb.BLL.LoanRules();
        System.Data.DataSet ds           = loanRulesMgr.GetList(" Fileid=" + this.iLoanID.ToString());
        int iRuleCount = ds.Tables[0].Rows.Count;
        this.hdnAddRuleNum.Value = (20 - iRuleCount).ToString();

        #endregion

        #region 初始化Rule列表
        this.RuleSqlDataSource.ConnectionString = LPWeb.DAL.DbHelperSQL.connectionString;

        string sSql = "select * from Template_Rules where Enabled=1 and RuleId not in (select RuleId from LoanRules where Fileid=" + this.iLoanID.ToString() + " and RuleId is not null)"
                      + " AND RuleScope = 0 AND (LoanTarget = 0 OR LoanTarget = 2)";

        //
        //Check prospect loan
        if (iLoanID != 0)
        {
            LPWeb.BLL.Loans   loanMgr   = new LPWeb.BLL.Loans();
            LPWeb.Model.Loans loanModel = loanMgr.GetModel(iLoanID);
            if (loanModel.Status.Trim().ToLower() == "prospect")
            {
                this.hdnProspectLoan.Value = "true";
                sSql = "SELECT * FROM Template_Rules WHERE Enabled=1 AND RuleId NOT IN (SELECT RuleId FROM LoanRules WHERE Fileid=" + this.iLoanID.ToString() + " AND RuleId IS NOT NULL)"
                       + " AND RuleScope = 0 AND (LoanTarget = 1 OR LoanTarget = 2)";
            }
        }

        this.RuleSqlDataSource.SelectCommand = sSql;
        this.gridRuleList.DataBind();

        #endregion
    }
示例#2
0
    private void BindDDL()
    {
        try
        {
            ServiceTypes type = new ServiceTypes();
            DataSet      ds   = type.GetList(" Enabled=1 ORDER BY ServiceType ASC");
            ddlServiceTypes.DataTextField  = "ServiceType";
            ddlServiceTypes.DataValueField = "ServiceType";
            ddlServiceTypes.DataSource     = ds;
            ddlServiceTypes.DataBind();

            ddlServiceTypes.Items.Insert(0, new ListItem("All", "0"));
        }
        catch
        { }

        try
        {
            ContactRoles roles = new ContactRoles();
            DataSet      ds    = roles.GetList(" Name <> 'Borrower' AND Name <> 'CoBorrower' ORDER BY [Name] ASC");
            ddlContactRole.DataValueField = "ContactRoleID";
            ddlContactRole.DataTextField  = "Name";
            ddlContactRole.DataSource     = ds;
            ddlContactRole.DataBind();
        }
        catch
        { }

        try
        {
            LPWeb.Model.Loans model = new LPWeb.Model.Loans();
            Loans             loans = new Loans();
            model = loans.GetModel(CurrentFileId);
            if (model == null)
            {
                return;
            }

            //lbPointFile.Text
            lbProperty.Text = model.PropertyAddr + " " + model.PropertyCity + " " + model.PropertyState + " " + model.PropertyZip;
        }
        catch
        {
        }
    }
示例#3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region 校验页面参数

        string sReturnUrl = "../Pipeline/ProspectPipelineSummaryLoan.aspx";
        string sErrorMsg  = "Failed to load this page: missing required query string.";

        // FileID
        bool bIsValid = PageCommon.ValidateQueryString(this, "FileID", QueryStringType.ID);
        if (bIsValid == false)
        {
            PageCommon.WriteJsEnd(this, sErrorMsg, "window.parent.location.href='" + sReturnUrl + "'");
        }
        string sFileID = this.Request.QueryString["FileID"];
        this.hfFileID.Value = sFileID;
        try
        {
            this.iFileID = Convert.ToInt32(sFileID);
        }
        catch { }
        #endregion

        #region LoadbaseInfo
        loanInfo = bllLoans.GetModel(iFileID);

        if (loanInfo != null)
        {
            iBranchId = (loanInfo.BranchID == null) ? 0 : loanInfo.BranchID.Value;
        }

        pointFileInfo = bllPointFile.GetModel(iFileID);

        iPointFolderId = (pointFileInfo == null || pointFileInfo.FolderId <= 0) ? 0 : pointFileInfo.FolderId;

        if (iPointFolderId > 0)
        {
            pointFolderInfo = bllPointFolders.GetModel(pointFileInfo.FolderId);
        }
        #endregion

        if (!IsPostBack)
        {
            BindData();
        }
    }
示例#4
0
    void BindControls()
    {
        try
        {
            Contacts contact = new Contacts();
            lbBorrower.Text = contact.GetBorrower(CurrentFileId);

            LPWeb.Model.Loans model = new LPWeb.Model.Loans();
            Loans             loans = new Loans();
            model = loans.GetModel(CurrentFileId);
            if (model == null)
            {
                return;
            }

            //lbPointFile.Text
            lbProperty.Text = model.PropertyAddr + " " + model.PropertyCity + " " + model.PropertyState + " " + model.PropertyZip;
        }
        catch
        { }
    }
    /// <summary>
    /// Binds the page.
    /// </summary>
    private void BindPage()
    {
        if (CurrentFileId < 1)
        {
            return;
        }

        DataSet ds = bllStages.GetLoanStageSetupInfo(CurrentFileId);

        if (ds == null || ds.Tables.Count == 0 || ds.Tables[0].Rows.Count == 0)
        {
            gvWfGrid.DataSource = null;
            gvWfGrid.DataBind();
            return;
        }

        DateTime dtMin = DateTime.MinValue;

        if (DateTime.TryParse(ds.Tables[0].Rows[0]["EstCloseDate"].ToString(), out dtMin))
        {
            tbxTargetCloseDate.Text = dtMin.ToShortDateString();
        }
        LPWeb.BLL.Loans   loanMgr   = new Loans();
        LPWeb.Model.Loans loanModel = loanMgr.GetModel(CurrentFileId);
        if (loanModel.EstCloseDate != null)
        {
            tbxTargetCloseDate.Text = loanModel.EstCloseDate.Value.ToShortDateString();
        }
        if (loanModel.Created != null)
        {
            lbDateCreated.Text = loanModel.Created.Value.ToShortDateString();
        }

        gvWfGrid.DataSource = ds;
        gvWfGrid.DataBind();
    }
示例#6
0
    /// <summary>
    /// Binds the page.
    /// </summary>
    private void BindPage()
    {
        if (CurrentFileId < 1)
        {
            PageCommon.WriteJsEnd(this, sErrorMsg, "window.location.href='" + sReturnPage + "'");
            return;
        }

        DataSet ds = bllStages.GetLoanStageSetupInfo(CurrentFileId);

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

        foreach (DataRow LoanStageRow in ds.Tables[0].Rows)
        {
            int iLoanStageId = Convert.ToInt32(LoanStageRow["LoanStageId"]);

            LoanStages LoanStagesMrg = new LoanStages();
            DataTable  LoanStageInfo = LoanStagesMrg.GetList(" LoanStageId=" + iLoanStageId).Tables[0];

            if (LoanStageInfo.Rows.Count > 0)
            {
                #region 获取Template_Stage.Alias

                string sWflStageName = LoanStageInfo.Rows[0]["StageName"].ToString();
                string sDiaplayAs    = LoanStageInfo.Rows[0]["StageName"].ToString();

                if (LoanStageInfo.Rows[0]["WflStageId"] != DBNull.Value)
                {
                    string sWflStageId = LoanStageInfo.Rows[0]["WflStageId"].ToString();

                    Template_Wfl_Stages Template_Wfl_Stages1     = new Template_Wfl_Stages();
                    DataTable           Template_Wfl_Stages_info = Template_Wfl_Stages1.GetList(" WflStageId=" + sWflStageId).Tables[0];
                    if (Template_Wfl_Stages_info.Rows.Count > 0)
                    {
                        sWflStageName = Template_Wfl_Stages_info.Rows[0]["Name"].ToString();

                        string sTemplStageId = Template_Wfl_Stages_info.Rows[0]["TemplStageId"].ToString();
                        if (sTemplStageId != string.Empty)
                        {
                            Template_Stages Template_Stages1    = new Template_Stages();
                            DataTable       Template_Stage_Info = Template_Stages1.GetStageTemplateList(" and TemplStageId=" + sTemplStageId);
                            if (Template_Stage_Info.Rows.Count > 0)
                            {
                                string sAlias = Template_Stage_Info.Rows[0]["Alias"].ToString();
                                if (sAlias != string.Empty)
                                {
                                    sDiaplayAs = sAlias;
                                }
                            }
                        }
                    }
                }

                LoanStageRow["StageName"] = sWflStageName;
                LoanStageRow["Alias"]     = sDiaplayAs;

                #endregion
            }
        }



        DateTime dtMin = DateTime.MinValue;
        if (DateTime.TryParse(ds.Tables[0].Rows[0]["EstCloseDate"].ToString(), out dtMin))
        {
            tbxTargetCloseDate.Text = dtMin.ToShortDateString();
        }
        Loans             loanMgr   = new Loans();
        LPWeb.Model.Loans loanModel = loanMgr.GetModel(CurrentFileId);
        if (loanModel.EstCloseDate != null)
        {
            tbxTargetCloseDate.Text = loanModel.EstCloseDate.Value.ToShortDateString();
        }
        gvWfGrid.DataSource = ds;
        gvWfGrid.DataBind();
    }
示例#7
0
    private void BindItems()
    {
        LPWeb.Model.Loans model = new LPWeb.Model.Loans();
        model = loans.GetModel(iFileID);
        if (model.LoanAmount.HasValue)
        {
            lbLoanAmount.Text = "$" + string.Format("{0:N0}", model.LoanAmount.Value);
        }
        if (model.SalesPrice.HasValue)
        {
            lbSalesPrice.Text = "$" + string.Format("{0:N0}", model.SalesPrice.Value);
        }
        if (model.AppraisedValue.HasValue)
        {
            lbAppraisedValue.Text = "$" + string.Format("{0:N0}", model.AppraisedValue.Value);
        }
        if (model.Rate.HasValue)
        {
            lbRate.Text = model.Rate.Value.ToString("#.####") + "%";
        }
        lbLoanType.Text = model.LoanType;

        if (model.DownPay.HasValue)
        {
            lbDownPayment.Text = model.DownPay.Value.ToString("#.##") + "%";
        }

        if (model.MonthlyPayment.HasValue)
        {
            lbMonthlyPayment.Text = "$" + string.Format("{0:N0}", model.MonthlyPayment.Value);
        }
        if (model.LTV.HasValue)
        {
            lbLTV.Text = model.LTV.Value.ToString("#.##") + "%";
        }
        if (model.CLTV.HasValue)
        {
            lbCLTV.Text = model.CLTV.Value.ToString("#.##") + "%";
        }
        string term = string.Empty;

        if (model.Term.HasValue)
        {
            term = model.Term.Value.ToString();
        }
        string due = string.Empty;

        if (model.Due.HasValue)
        {
            due = model.Due.Value.ToString();
        }
        lbTermDue.Text      = term + "/" + due;
        lbPurpose.Text      = model.Purpose;
        lbLienPosition.Text = model.LienPosition;
        lbOccupancy.Text    = model.Occupancy;
        lbProgram.Text      = model.Program;
        lbCCScenario.Text   = model.CCScenario;
        lbCounty.Text       = model.County;

        lbLender.Text = loans.GetLender(iFileID);

        //if (model.Lender.HasValue)
        //{
        //    lbLender.Text = string.Empty;
        //    ContactCompanies cc = new ContactCompanies();
        //    LPWeb.Model.ContactCompanies ccmodel= cc.GetModel(model.Lender.Value);
        //    if (ccmodel != null)
        //    {
        //        lbLender.Text = ccmodel.Name;
        //    }
        //}
    }
示例#8
0
    private void FillLabels()
    {
        if (iFileID == 0)
        {
            return;
        }
        LPWeb.Model.Loans model = new LPWeb.Model.Loans();
        model = loan.GetModel(iFileID);
        if (model == null)
        {
            return;
        }
        if (model.LoanAmount.HasValue && model.LoanAmount.Value > 0)
        {
            txbAmount.Text = string.Format("{0:C}", model.LoanAmount.Value.ToString());
        }
        else
        {
            txbAmount.Text = string.Empty;
        }

        if (model.Rate.HasValue && model.Rate.Value > 0)
        {
            txbInterestRate.Text = model.Rate.Value.ToString();
        }
        else
        {
            txbInterestRate.Text = string.Empty;
        }

        if (model.EstCloseDate.HasValue && model.EstCloseDate.Value > DateTime.Parse("1900-1-1"))
        {
            txbEstimatedDate.Text = model.EstCloseDate.Value.ToShortDateString();
        }
        else
        {
            txbEstimatedDate.Text = string.Empty;
        }
        if (model.Program.Length == 0)
        {
            ddlLoanProgram.SelectedIndex = 0;
        }
        else
        {
            if (!ddlLoanProgram.Items.Contains(new ListItem(model.Program, model.Program)))
            {
                ddlLoanProgram.Items.Add(new ListItem(model.Program, model.Program));
            }
            ddlLoanProgram.SelectedValue = model.Program;
        }
        txbPropertyAddress.Text = model.PropertyAddr;
        txbCity.Text            = model.PropertyCity;
        txbZip.Text             = model.PropertyZip;
        if (model.PropertyState.Length > 0)
        {
            ddlState.SelectedValue = model.PropertyState.Trim();
        }
        else
        {
            ddlState.SelectedIndex = 0;
        }
        if (model.Ranking.Length > 0)
        {
            ddlRanking.SelectedValue = model.Ranking.ToLower();
        }
        else
        {
            ddlRanking.SelectedIndex = -1;
        }
        if (model.LienPosition.Length > 0)
        {
            ddlLienPosition.SelectedValue = model.LienPosition.Trim();
        }
        if (model.Purpose.Length > 0)
        {
            ddlPurpose.SelectedValue = model.Purpose.Trim();
        }
        Contacts contact = new Contacts();

        try
        {
            string sBoID = contact.GetBorrowerDetails(iFileID, "Borrower")["ContactID"].ToString();
            ddlBorrower.SelectedValue = sBoID;
        }
        catch
        { }

        try
        {
            var    dr     = contact.GetBorrowerDetails(iFileID, "CoBorrower");
            string sCBoID = dr["ContactID"].ToString();
            //ddlCoBorrower.SelectedValue = sCBoID;
            hdnCoBorrowerID.Value = sCBoID;
            txtCBFirstname.Text   = dr["FirstName"] != DBNull.Value ? dr["FirstName"].ToString() : "";
            txtCBMiddlename.Text  = dr["Middlename"] != DBNull.Value ? dr["Middlename"].ToString() : "";
            txtCBLastname.Text    = dr["Lastname"] != DBNull.Value ? dr["Lastname"].ToString() : "";

            hdnCoBorrowerName.Value = txtCBFirstname.Text + txtCBMiddlename.Text + txtCBLastname.Text;
        }
        catch
        { }

        BindPoint(iFileID);

        if (model.Created.HasValue)
        {
            lbCreatedOn.Text = model.Created.Value.ToShortDateString();
        }
        if (model.CreatedBy.HasValue)
        {
            lbCreatedBy.Text = GetUserName(model.CreatedBy.Value);
        }

        if (model.Modifed.HasValue)
        {
            lbCreatedOn.Text = model.Modifed.Value.ToShortDateString();
        }
        if (model.ModifiedBy.HasValue)
        {
            lbCreatedBy.Text = GetUserName(model.ModifiedBy.Value);
        }

        //add by gdc 20110828

        txbPropetyType.Text      = model.PropertyType;
        txbHousingStatus.Text    = model.HousingStatus;
        cbInterestOnly.Checked   = model.InterestOnly;
        cbIncludeEscrows.Checked = model.IncludeEscrows;

        txbCoborrowerType.Text = model.CoBrwType;
        txbRentAmount.Text     = model.RentAmount == null ? "" : Convert.ToDecimal(model.RentAmount).ToString("n0");


        //gdc crm33
        LPWeb.Model.Prospect modelProspect = new LPWeb.Model.Prospect();

        LPWeb.BLL.Prospect bllProspect = new Prospect();
        modelProspect = bllProspect.GetModel(iContactID);

        if (modelProspect != null & modelProspect.Referral != null)
        {
            hdnReferralID.Value = modelProspect.Referral.ToString();

            string sqlReferralName = string.Format("select dbo.lpfn_GetReferralName({0})", iFileID);

            var obj = LPWeb.DAL.DbHelperSQL.GetSingle(sqlReferralName);
            if (obj != null)
            {
                txtReferral.Text = obj.ToString();
            }
        }

        ddlLeadSource.SelectedValue = modelProspect.LeadSource;
    }
示例#9
0
    protected void btnCopy_Click(object sender, EventArgs e)
    {
        if (ddlCopyFrom.SelectedIndex < 0)
        {
            return;
        }
        try
        {
            int FileID = int.Parse(ddlCopyFrom.SelectedItem.Value);
            LPWeb.Model.Loans model = new LPWeb.Model.Loans();
            model = loan.GetModel(FileID);
            // Loan.Status+”Loan “+Loans.LienPosition+” – “+Loans.PropertyAddr

            if (model == null)
            {
                return;
            }
            if (model.LoanAmount.HasValue && model.LoanAmount.Value > 0)
            {
                txbAmount.Text = model.LoanAmount.Value.ToString("n0");
            }
            else
            {
                txbAmount.Text = string.Empty;
            }

            if (model.Rate.HasValue && model.Rate.Value > 0)
            {
                txbInterestRate.Text = model.Rate.Value.ToString();
            }
            else
            {
                txbInterestRate.Text = string.Empty;
            }

            //if (model.EstCloseDate.HasValue && model.EstCloseDate.Value > DateTime.Parse("1900-1-1"))
            //{
            //    txbEstimatedDate.Text = model.EstCloseDate.Value.ToShortDateString();
            //}
            //else
            //{
            //    txbEstimatedDate.Text = string.Empty;
            //}
            if (model.Program.Length == 0)
            {
                ddlLoanProgram.SelectedIndex = 0;
            }
            else
            {
                ddlLoanProgram.SelectedValue = model.Program;
            }
            if (model.LienPosition.Length == 0)
            {
                ddlLienPosition.SelectedIndex = 0;
            }
            else
            {
                ddlLienPosition.SelectedValue = model.LienPosition;
            }

            if (model.Purpose.Length == 0)
            {
                ddlPurpose.SelectedIndex = 0;
            }
            else
            {
                ddlPurpose.SelectedValue = model.Purpose;
            }
            txbPropertyAddress.Text = model.PropertyAddr;
            txbCity.Text            = model.PropertyCity;
            txbZip.Text             = model.PropertyZip;
            if (model.PropertyState.Length > 0)
            {
                ddlState.SelectedValue = model.PropertyState.Trim();
            }
            else
            {
                ddlState.SelectedIndex = 0;
            }
            if (model.Ranking.Length > 0)
            {
                ddlRanking.SelectedValue = model.Ranking.ToLower();
            }
            else
            {
                ddlRanking.SelectedIndex = -1;
            }
        }
        catch (Exception ex)
        {
            LPLog.LogMessage(ex.Message);
        }
    }
示例#10
0
    private bool SaveLocal(ref string errMsg)
    {
        if (!string.IsNullOrEmpty(FileName) && FileName.Length > 0 && !FileName.ToUpper().EndsWith(".PRS") && !FileName.ToUpper().EndsWith(".BRW"))
        {
            errMsg = "The filename must end with “.PRS” or “.BRW”. ";
            return(false);
        }

        try
        {
            #region Save BranchId
            Loans             bllLoans = new Loans();
            LPWeb.Model.Loans loanInfo = new LPWeb.Model.Loans();
            loanInfo = bllLoans.GetModel(iFileID);
            if (loanInfo != null)
            {
                loanInfo.BranchID = BranchId;
                bllLoans.Update(loanInfo);
            }
            #endregion

            //Save Loan Officer

            #region Loan Officer

            LoanTeam bllLoanTeam   = new LoanTeam();
            Users    bllUsers      = new Users();
            var      loanOfficer   = bllLoanTeam.GetLoanOfficer(iFileID);
            var      loanOfficerId = bllLoanTeam.GetLoanOfficerID(iFileID);

            #region Loan Officer RolesID   =loanOfficerRolesId
            Roles bllRoles           = new Roles();
            int   loanOfficerRolesId = 3;//default;
            try
            {
                loanOfficerRolesId = bllRoles.GetModelList(" Name = 'Loan Officer' ").FirstOrDefault().RoleId;
            }
            catch { }
            #endregion

            if (LoanOfficerId != loanOfficerId)
            {
                var loanTeamInfo = bllLoanTeam.GetModel(iFileID, loanOfficerRolesId, loanOfficerId);

                if (loanTeamInfo == null)
                {
                    loanTeamInfo = new LPWeb.Model.LoanTeam();
                }
                else
                {
                    bllLoanTeam.Delete(iFileID, loanOfficerRolesId, loanOfficerId);
                }
                loanTeamInfo.FileId = iFileID;
                loanTeamInfo.RoleId = loanOfficerRolesId;
                loanTeamInfo.UserId = LoanOfficerId;


                bllLoanTeam.Add(loanTeamInfo);
            }

            #endregion

            #region Local PointFile  ----pointFileInfo and  pointFolderInfo

            PointFiles   bllPointFile    = new PointFiles();
            PointFolders bllPointFolders = new PointFolders();


            LPWeb.Model.PointFiles pointFileInfo = bllPointFile.GetModel(iFileID);
            var IsAddPointFile = false;
            if (pointFileInfo == null)
            {
                IsAddPointFile = true;
                pointFileInfo  = new LPWeb.Model.PointFiles();
            }
            else
            {
                IsAddPointFile = false;
            }

            pointFileInfo.FileId = iFileID;
            if (FolderId > 0)
            {
                pointFileInfo.FolderId = FolderId;
            }
            if (FileName.Length > 0)
            {
                pointFileInfo.Name = FileName;
            }


            if (IsAddPointFile)
            {
                bllPointFile.Add(pointFileInfo);
            }
            else
            {
                bllPointFile.UpdateBase(pointFileInfo);
            }

            #endregion
        }
        catch (Exception ex)
        {
            errMsg = ex.Message;
            return(false);
        }
        return(true);
    }
示例#11
0
    public void BindData()
    {
        LPWeb.BLL.Loans    bllLoans    = new LPWeb.BLL.Loans();
        LPWeb.BLL.LoanTeam bllLoanTeam = new LPWeb.BLL.LoanTeam();
        LPWeb.BLL.Users    bllUsers    = new LPWeb.BLL.Users();
        LPWeb.Model.Loans  loanInfo    = bllLoans.GetModel(LoanID);

        DataTable LoanInfo_datatable = bllLoans.GetLoanInfo(LoanID);
        decimal   loanAmount         = 0;

        LoanPointFields LoanPointFieldsMgr = new LoanPointFields();

        //LPWeb.Model.LoanPointFields PointFieldInfo = LoanPointFieldsMgr.GetPointFieldInfo(LoanID, 21017);
        LPWeb.Model.LoanPointFields PointFieldInfo = LoanPointFieldsMgr.GetModel(LoanID, 21017);
        if (PointFieldInfo != null && !string.IsNullOrEmpty(PointFieldInfo.CurrentValue))
        {
            decimal.TryParse(PointFieldInfo.CurrentValue, out loanAmount);
        }
        if (loanAmount <= 0 && LoanInfo_datatable != null && LoanInfo_datatable.Rows.Count > 0)
        {
            loanAmount = LoanInfo_datatable.Rows[0]["LoanAmount"] == DBNull.Value ? 0 : (decimal)LoanInfo_datatable.Rows[0]["LoanAmount"];
        }
        this.labLoanamount.Text = loanAmount.ToString("n2");

        var list = new List <ViewCompDetail>();

        var Lo = new ViewCompDetail();

        Lo.Type = "Loan Officer";
        var LOUserId = bllLoanTeam.GetLoanOfficerID(LoanID);

        Lo.Name   = bllLoanTeam.GetLoanOfficer(LoanID);
        Lo.Rate   = GetUserCompRate(LOUserId);
        Lo.Amount = Lo.Rate * loanAmount / 100.00M;
        list.Add(Lo);


        loanInfo.BranchID = loanInfo.BranchID != null ? loanInfo.BranchID : 0;
        var branchM = new ViewCompDetail();

        branchM.Type = "Branch Manager";
        LPWeb.BLL.BranchManagers bllbranM = new LPWeb.BLL.BranchManagers();
        var branchUserId = 0;
        var branchObj    = bllbranM.GetModelList("BranchId =" + loanInfo.BranchID).FirstOrDefault();

        if (branchObj != null)
        {
            branchUserId = branchObj.BranchMgrId;
        }

        LPWeb.Model.Users userBrM = bllUsers.GetModel(branchUserId);
        if (userBrM != null && userBrM.UserId == branchUserId)
        {
            branchM.Name   = userBrM.LastName + "," + userBrM.FirstName;
            branchM.Rate   = GetBranchMgrCompRate(LOUserId);
            branchM.Amount = branchM.Rate * loanAmount / 100.00M;
        }
        list.Add(branchM);


        loanInfo.DivisionID = loanInfo.DivisionID != null ? loanInfo.DivisionID : 0;
        var divisionM = new ViewCompDetail();

        divisionM.Type = "Division Manager";
        LPWeb.BLL.DivisionExecutives bllDivM = new LPWeb.BLL.DivisionExecutives();
        var DivMUserId = 0;
        var divobj     = bllDivM.GetModelList("DivisionId =" + loanInfo.DivisionID).FirstOrDefault();

        if (divobj != null)
        {
            DivMUserId = divobj.ExecutiveId;
        }

        LPWeb.Model.Users userDivM = bllUsers.GetModel(DivMUserId);
        if (userDivM != null && userDivM.UserId == DivMUserId)
        {
            divisionM.Name   = userDivM.LastName + "," + userDivM.FirstName;
            divisionM.Rate   = GetDivisionMgrCompRate(LOUserId);
            divisionM.Amount = divisionM.Rate * loanAmount / 100.00M;
        }
        list.Add(divisionM);

        loanInfo.RegionID = loanInfo.RegionID != null ? loanInfo.RegionID : 0;
        var RegionM = new ViewCompDetail();

        RegionM.Type = "Region Manager";
        LPWeb.BLL.RegionExecutives bllRegionM = new LPWeb.BLL.RegionExecutives();
        var RegionMUserId = 0;
        var regionObj     = bllRegionM.GetModelList("RegionId =" + loanInfo.RegionID).FirstOrDefault();

        if (regionObj != null)
        {
            RegionMUserId = regionObj.ExecutiveId;
        }

        LPWeb.Model.Users userRegionM = bllUsers.GetModel(RegionMUserId);
        if (userRegionM != null && userRegionM.UserId == RegionMUserId)
        {
            RegionM.Name   = userRegionM.LastName + "," + userRegionM.FirstName;
            RegionM.Rate   = GetRegionMgrCompRate(LOUserId);
            RegionM.Amount = RegionM.Rate * loanAmount / 100.00M;
        }
        list.Add(RegionM);


        gvCompDetail.DataSource = list;
        gvCompDetail.DataBind();
    }
示例#12
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LPWeb.Model.Loans> DataTableToList(DataTable dt)
        {
            List <LPWeb.Model.Loans> modelList = new List <LPWeb.Model.Loans>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LPWeb.Model.Loans model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.Loans();
                    if (dt.Rows[n]["FileId"].ToString() != "")
                    {
                        model.FileId = int.Parse(dt.Rows[n]["FileId"].ToString());
                    }
                    if (dt.Rows[n]["AppraisedValue"].ToString() != "")
                    {
                        model.AppraisedValue = decimal.Parse(dt.Rows[n]["AppraisedValue"].ToString());
                    }
                    model.CCScenario = dt.Rows[n]["CCScenario"].ToString();
                    if (dt.Rows[n]["CLTV"].ToString() != "")
                    {
                        model.CLTV = decimal.Parse(dt.Rows[n]["CLTV"].ToString());
                    }
                    model.County = dt.Rows[n]["County"].ToString();
                    if (dt.Rows[n]["DateOpen"].ToString() != "")
                    {
                        model.DateOpen = DateTime.Parse(dt.Rows[n]["DateOpen"].ToString());
                    }
                    if (dt.Rows[n]["DateSubmit"].ToString() != "")
                    {
                        model.DateSubmit = DateTime.Parse(dt.Rows[n]["DateSubmit"].ToString());
                    }
                    if (dt.Rows[n]["DateApprove"].ToString() != "")
                    {
                        model.DateApprove = DateTime.Parse(dt.Rows[n]["DateApprove"].ToString());
                    }
                    if (dt.Rows[n]["DateClearToClose"].ToString() != "")
                    {
                        model.DateClearToClose = DateTime.Parse(dt.Rows[n]["DateClearToClose"].ToString());
                    }
                    if (dt.Rows[n]["DateDocs"].ToString() != "")
                    {
                        model.DateDocs = DateTime.Parse(dt.Rows[n]["DateDocs"].ToString());
                    }
                    if (dt.Rows[n]["DateFund"].ToString() != "")
                    {
                        model.DateFund = DateTime.Parse(dt.Rows[n]["DateFund"].ToString());
                    }
                    if (dt.Rows[n]["DateRecord"].ToString() != "")
                    {
                        model.DateRecord = DateTime.Parse(dt.Rows[n]["DateRecord"].ToString());
                    }
                    if (dt.Rows[n]["DateClose"].ToString() != "")
                    {
                        model.DateClose = DateTime.Parse(dt.Rows[n]["DateClose"].ToString());
                    }
                    if (dt.Rows[n]["DateDenied"].ToString() != "")
                    {
                        model.DateDenied = DateTime.Parse(dt.Rows[n]["DateDenied"].ToString());
                    }
                    if (dt.Rows[n]["DateCanceled"].ToString() != "")
                    {
                        model.DateCanceled = DateTime.Parse(dt.Rows[n]["DateCanceled"].ToString());
                    }
                    if (dt.Rows[n]["DownPay"].ToString() != "")
                    {
                        model.DownPay = decimal.Parse(dt.Rows[n]["DownPay"].ToString());
                    }
                    if (dt.Rows[n]["EstCloseDate"].ToString() != "")
                    {
                        model.EstCloseDate = DateTime.Parse(dt.Rows[n]["EstCloseDate"].ToString());
                    }
                    if (dt.Rows[n]["Lender"].ToString() != "")
                    {
                        model.Lender = int.Parse(dt.Rows[n]["Lender"].ToString());
                    }
                    model.LienPosition = dt.Rows[n]["LienPosition"].ToString();
                    if (dt.Rows[n]["LoanAmount"].ToString() != "")
                    {
                        model.LoanAmount = decimal.Parse(dt.Rows[n]["LoanAmount"].ToString());
                    }
                    model.LoanNumber = dt.Rows[n]["LoanNumber"].ToString();
                    model.LoanType   = dt.Rows[n]["LoanType"].ToString();
                    if (dt.Rows[n]["LTV"].ToString() != "")
                    {
                        model.LTV = decimal.Parse(dt.Rows[n]["LTV"].ToString());
                    }
                    if (dt.Rows[n]["MonthlyPayment"].ToString() != "")
                    {
                        model.MonthlyPayment = decimal.Parse(dt.Rows[n]["MonthlyPayment"].ToString());
                    }
                    model.LenderNotes   = dt.Rows[n]["LenderNotes"].ToString();
                    model.Occupancy     = dt.Rows[n]["Occupancy"].ToString();
                    model.Program       = dt.Rows[n]["Program"].ToString();
                    model.PropertyAddr  = dt.Rows[n]["PropertyAddr"].ToString();
                    model.PropertyCity  = dt.Rows[n]["PropertyCity"].ToString();
                    model.PropertyState = dt.Rows[n]["PropertyState"].ToString();
                    model.PropertyZip   = dt.Rows[n]["PropertyZip"].ToString();
                    model.Purpose       = dt.Rows[n]["Purpose"].ToString();
                    if (dt.Rows[n]["Rate"].ToString() != "")
                    {
                        model.Rate = decimal.Parse(dt.Rows[n]["Rate"].ToString());
                    }
                    if (dt.Rows[n]["RateLockExpiration"].ToString() != "")
                    {
                        model.RateLockExpiration = DateTime.Parse(dt.Rows[n]["RateLockExpiration"].ToString());
                    }
                    if (dt.Rows[n]["SalesPrice"].ToString() != "")
                    {
                        model.SalesPrice = decimal.Parse(dt.Rows[n]["SalesPrice"].ToString());
                    }
                    if (dt.Rows[n]["Term"].ToString() != "")
                    {
                        model.Term = int.Parse(dt.Rows[n]["Term"].ToString());
                    }
                    if (dt.Rows[n]["Due"].ToString() != "")
                    {
                        model.Due = int.Parse(dt.Rows[n]["Due"].ToString());
                    }
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
示例#13
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public void Update(LPWeb.Model.Loans model)
 {
     dal.Update(model);
 }
示例#14
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(LPWeb.Model.Loans model)
 {
     return(dal.Add(model));
 }
示例#15
0
    private void FillLabels()
    {
        if (iFileID == 0)
        {
            return;
        }
        LPWeb.Model.Loans model = new LPWeb.Model.Loans();
        model = loan.GetModel(iFileID);
        if (model == null)
        {
            return;
        }
        if (model.LoanAmount.HasValue && model.LoanAmount.Value > 0)
        {
            txbAmount.Text = model.LoanAmount.Value.ToString();
        }
        else
        {
            txbAmount.Text = string.Empty;
        }

        if (model.Rate.HasValue && model.Rate.Value > 0)
        {
            txbInterestRate.Text = model.Rate.Value.ToString();
        }
        else
        {
            txbInterestRate.Text = string.Empty;
        }

        if (model.EstCloseDate.HasValue && model.EstCloseDate.Value > DateTime.Parse("1900-1-1"))
        {
            txbEstimatedDate.Text = model.EstCloseDate.Value.ToShortDateString();
        }
        else
        {
            txbEstimatedDate.Text = string.Empty;
        }
        if (model.Program.Length == 0)
        {
            ddlLoanProgram.Text = string.Empty;
        }
        else
        {
            ddlLoanProgram.Text = model.Program;
        }
        if (model.Purpose.Length == 0)
        {
            ddlPurpose.Text = string.Empty;
        }
        else
        {
            ddlPurpose.Text = model.Purpose.Trim();
        }

        if (model.LienPosition.Length == 0)
        {
            ddlLien.Text = string.Empty;
        }
        else
        {
            ddlLien.Text = model.LienPosition.Trim();
        }

        txbPropertyAddress.Text = model.PropertyAddr;
        txbCity.Text            = model.PropertyCity;
        txbZip.Text             = model.PropertyZip;
        if (model.PropertyState.Length > 0)
        {
            ddlState.Text = string.Empty;
        }
        else
        {
            ddlState.Text = model.PropertyState.Trim();
        }
        try
        {
            ddlRanking.Text = model.Ranking;
        }
        catch
        { }

        Contacts contact = new Contacts();

        try
        {
            ddlBorrower.Text = contact.GetBorrower(iFileID);
        }
        catch
        { }

        try
        {
            ddlCoBorrower.Text = contact.GetCoBorrower(iFileID);
        }
        catch
        { }
        BindPoint(iFileID);
        try
        {
            Users user = new Users();

            ddlLoanOfficer.Text = user.GetLoanOfficer(iFileID);
        }
        catch
        { }

        if (model.Created.HasValue)
        {
            lbCreatedOn.Text = model.Created.Value.ToShortDateString();
        }
        if (model.CreatedBy.HasValue)
        {
            lbCreatedBy.Text = GetUserName(model.CreatedBy.Value);
        }

        if (model.Modifed.HasValue)
        {
            lbCreatedOn.Text = model.Modifed.Value.ToShortDateString();
        }
        if (model.ModifiedBy.HasValue)
        {
            lbCreatedBy.Text = GetUserName(model.ModifiedBy.Value);
        }
    }