Exemple #1
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            if (cbEnableAutoFileNaming.Checked && string.IsNullOrEmpty(txbPrefix.Text.Trim()))
            {
                PageCommon.AlertMsg(this.Page, "The Prefix field cannot be empty.");
                return;
            }

            string digits = "";

            if (cbdigitsName.Checked)
            {
                digits = txtdigits.Text.Trim();
            }



            BLL.PointFolders bll = new PointFolders();


            bll.UpdatePointFolderAutoNaming(this.iFolderID, cbEnableAutoFileNaming.Checked, txbPrefix.Text.Trim(), cbdigitsName.Checked, digits);

            this.ClientScript.RegisterClientScriptBlock(this.GetType(), "_Success", "$('#divContent').hide();alert('Save successfully.');window.parent.location.href=window.parent.location.href;", true);


            //Page.ClientScript.RegisterClientScriptBlock(GetType(), "_Success", "<script>alert('Save successfully.');document.location='/_layouts/LPWeb/Settings/PointFolderDetails.aspx?PointFolderID='" + this.iFolderID + "'</script>",true);

            //Response.Write(" < script language=javascript>alert('Save successfully.');window.location.reload(true ); < /script>");
        }
    protected void Page_Load(object sender, EventArgs e)
    {
        // json示例
        // [{"FolderID":"1","Name":"FolderA"},{"FolderID":"2","Name":"FolderB"}]

        #region 校验页面参数

        // RegionID
        string sRegionIDs = this.Request.QueryString["RegionIDs"].ToString();

        // DivisionID
        string sDivisionIDs = this.Request.QueryString["DivisionIDs"].ToString();

        // BranchIDs
        string sBranchIDs = this.Request.QueryString["BranchIDs"].ToString();

        #endregion

        #region Point Folder

        PointFolders PointFolderMgr  = new PointFolders();
        DataTable    PointFolderList = null;

        if (this.CurrUser.sRoleName == "Executive")
        {
            PointFolderList = PointFolderMgr.GetPointFolder_Executive(this.CurrUser.iUserID, sRegionIDs, sDivisionIDs, sBranchIDs);
        }
        else if (this.CurrUser.sRoleName == "Branch Manager")
        {
            PointFolderList = PointFolderMgr.GetPointFolder_BranchManager(this.CurrUser.iUserID, sRegionIDs, sDivisionIDs, sBranchIDs);
        }
        else
        {
            PointFolderList = PointFolderMgr.GetPointFolder_User(this.CurrUser.iUserID, sRegionIDs, sDivisionIDs, sBranchIDs);
        }

        #endregion

        StringBuilder sbJson = new StringBuilder();

        int i = 0;
        foreach (DataRow PointFolderRow in PointFolderList.Rows)
        {
            string sFolderID = PointFolderRow["FolderID"].ToString();
            string sName     = PointFolderRow["Name"].ToString();

            if (i == 0)
            {
                sbJson.Append("{\"FolderID\":\"" + sFolderID + "\",\"Name\":\"" + sName + "\"}");
            }
            else
            {
                sbJson.Append(",{\"FolderID\":\"" + sFolderID + "\",\"Name\":\"" + sName + "\"}");
            }

            i++;
        }

        this.Response.Write("[" + sbJson.ToString() + "]");
    }
Exemple #3
0
    private void BindPoint(int FileID)
    {
        try
        {
            //btnExport.Enabled = false;
            PointFiles             file      = new PointFiles();
            LPWeb.Model.PointFiles fileModel = new LPWeb.Model.PointFiles();
            fileModel = file.GetModel(iFileID);

            if (fileModel == null)
            {
                return;
            }
            txbPointFileName.Text = fileModel.Name;

            PointFolders             folder      = new PointFolders();
            LPWeb.Model.PointFolders folderModel = new LPWeb.Model.PointFolders();
            folderModel = folder.GetModel(fileModel.FolderId);
            if (folderModel != null && folderModel.Name.Length > 0)
            {
                ddlPointFolder.Text = folderModel.Name;
            }
            if (txbPointFileName.Text.Length > 0 && ddlPointFolder.Text.Length > 0)
            {
                //btnExport.Enabled = true;
            }
        }
        catch
        { }
    }
Exemple #4
0
    private void BindPoint(int FileID)
    {
        try
        {
            //btnExport.Enabled = false;
            PointFiles             file      = new PointFiles();
            LPWeb.Model.PointFiles fileModel = new LPWeb.Model.PointFiles();
            fileModel = file.GetModel(iFileID);

            if (fileModel == null)
            {
                return;
            }
            txbPointFileName.Text = fileModel.Name;
            PointFolders folder = new PointFolders();
            if (fileModel.FolderId > 0)
            {
                LPWeb.Model.PointFolders folderModel = new LPWeb.Model.PointFolders();
                folderModel = folder.GetModel(fileModel.FolderId);
                if (folderModel != null && folderModel.Name.Length > 0)
                {
                    ListItem item = new ListItem(folderModel.Name, folderModel.FolderId.ToString());
                    ddlPointFolder.Items.Insert(0, item);
                }
                ddlPointFolder.Enabled = false;
            }
            else
            if (ddlPointFolder.Items.Count > 1)
            {
                ddlPointFolder.Enabled = true;
            }

            if (txbPointFileName.Text.Length > 0 && ddlPointFolder.Text.Length > 0)
            {
                if (!txbPointFileName.Text.ToUpper().EndsWith(".PRS") &&
                    !txbPointFileName.Text.ToUpper().EndsWith(".BRW"))
                {
                    //btnExport.Enabled = false;
                    return;
                }
                string filename = System.IO.Path.GetFileName(txbPointFileName.Text);
                if (txbPointFileName.Text.ToUpper().EndsWith(".PRS"))
                {
                    txbPointFileName.Text = @"\PROSPECT\" + filename;
                }
                else
                {
                    txbPointFileName.Text = @"\BORROWER\" + filename;
                }
                ///btnExport.Enabled = true;
            }
        }
        catch (Exception ex)
        {
            LPLog.LogMessage(ex.Message);
        }
    }
Exemple #5
0
        private void BindPointFoldersSelection()
        {
            PointFolders folder = new PointFolders();

            try
            {
                string  strWhere = string.Format(" BranchID is null or BranchID = {0} order by [Name] asc ", iBranchID);
                DataSet ds       = folder.GetList(strWhere);
                if (ds == null || ds.Tables.Count < 1 || ds.Tables[0].Rows.Count < 1)
                {
                    //ds=null;
                }

                gridPointFolderSelectionList.AutoGenerateColumns = false;
                gridPointFolderSelectionList.DataSource          = ds.Tables[0];
                gridPointFolderSelectionList.DataBind();
            }
            catch
            { }
        }
    private int GetFolderID(string FolderName)
    {
        int FolderID = 0;

        try
        {
            PointFolders folder = new PointFolders();
            DataSet      ds     = folder.GetList(" [Name] = '" + FolderName + "' AND [Enabled] = 1");
            if (ds == null || ds.Tables.Count < 1 || ds.Tables[0].Rows.Count < 1)
            {
                FolderID = 0;
            }
            else
            {
                FolderID = int.Parse(ds.Tables[0].Rows[0]["FolderID"].ToString());
            }
        }
        catch
        { }
        return(FolderID);
    }
Exemple #7
0
        protected void btnSetDeault_Click(object sender, EventArgs e)
        {
            //Response.Write(hifId.Value);
            if (string.IsNullOrEmpty(hifId.Value))
            {
                return;
            }
            bool IsCancel = false;

            var val = hifId.Value.Split(':');

            if (val.Count() != 2)
            {
                return;
            }
            IsCancel = Convert.ToBoolean(val[1]);

            PointFolders folder = new PointFolders();

            folder.SetDefaultPoint(val[0], this.iBranchID, IsCancel);

            BindPointFolders();
        }
Exemple #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (this.IsPostBack == false)
        {
            #region Organizations

            #region Region

            Regions   RegionMgr  = new Regions();
            DataTable RegionList = null;

            if (this.CurrUser.sRoleName == "Executive")
            {
                RegionList = RegionMgr.GetRegionFilter_Executive(this.CurrUser.iUserID);
            }
            else if (this.CurrUser.sRoleName == "Branch Manager")
            {
                RegionList = RegionMgr.GetRegionFilter_Branch_Manager(this.CurrUser.iUserID);
            }
            else
            {
                RegionList = RegionMgr.GetUserRegions(this.CurrUser.iUserID);
            }

            if (RegionList.Rows.Count > 0)
            {
                DataRow NewRegionRow = RegionList.NewRow();
                NewRegionRow["RegionID"] = 0;
                NewRegionRow["Name"]     = "ALL";
                RegionList.Rows.InsertAt(NewRegionRow, 0);
            }

            this.ddlRegion.DataSource = RegionList;
            this.ddlRegion.DataBind();

            #endregion

            #region Division

            Divisions DivisionMgr  = new Divisions();
            DataTable DivisionList = null;

            if (this.CurrUser.sRoleName == "Executive")
            {
                DivisionList = DivisionMgr.GetDivisionFilter_Executive(this.CurrUser.iUserID, 0);
            }
            else if (this.CurrUser.sRoleName == "Branch Manager")
            {
                DivisionList = DivisionMgr.GetDivisionFilter_Branch_Manager(this.CurrUser.iUserID, 0);
            }
            else
            {
                DivisionList = DivisionMgr.GetDivisionFilter(this.CurrUser.iUserID, 0);
            }

            if (DivisionList.Rows.Count > 0)
            {
                DataRow NewDivisionRow = DivisionList.NewRow();
                NewDivisionRow["DivisionID"] = 0;
                NewDivisionRow["Name"]       = "ALL";
                DivisionList.Rows.InsertAt(NewDivisionRow, 0);
            }

            this.ddlDivision.DataSource = DivisionList;
            this.ddlDivision.DataBind();

            #endregion

            #region Branch

            Branches  BranchMgr  = new Branches();
            DataTable BranchList = null;

            if (this.CurrUser.sRoleName == "Executive")
            {
                BranchList = BranchMgr.GetBranchFilter_Executive(this.CurrUser.iUserID, 0, 0);
            }
            else if (this.CurrUser.sRoleName == "Branch Manager")
            {
                BranchList = BranchMgr.GetBranchFilter_Branch_Manager(this.CurrUser.iUserID, 0, 0);
            }
            else
            {
                BranchList = BranchMgr.GetBranchFilter(this.CurrUser.iUserID, 0, 0);
            }

            if (BranchList.Rows.Count > 0)
            {
                DataRow NewBranchRow = BranchList.NewRow();
                NewBranchRow["BranchID"] = 0;
                NewBranchRow["Name"]     = "ALL";
                BranchList.Rows.InsertAt(NewBranchRow, 0);
            }

            this.ddlBranch.DataSource = BranchList;
            this.ddlBranch.DataBind();

            #endregion

            #region PointFolder

            PointFolders PointFolderMgr  = new PointFolders();
            DataTable    PointFolderList = null;

            if (this.CurrUser.sRoleName == "Executive")
            {
                PointFolderList = PointFolderMgr.GetPointFolder_Executive(this.CurrUser.iUserID, "0", "0", "0");
            }
            else if (this.CurrUser.sRoleName == "Branch Manager")
            {
                PointFolderList = PointFolderMgr.GetPointFolder_BranchManager(this.CurrUser.iUserID, "0", "0", "0");
            }
            else
            {
                PointFolderList = PointFolderMgr.GetPointFolder_User(this.CurrUser.iUserID, "0", "0", "0");
            }

            if (PointFolderList.Rows.Count > 0)
            {
                DataRow NewPointFolderRow = PointFolderList.NewRow();
                NewPointFolderRow["FolderID"] = 0;
                NewPointFolderRow["Name"]     = "ALL";
                PointFolderList.Rows.InsertAt(NewPointFolderRow, 0);
            }

            this.ddlFolder.DataSource = PointFolderList;
            this.ddlFolder.DataBind();

            #endregion

            #endregion

            #region Users and Borrower

            #region Loan Officer

            DataTable LoanRolesList = this.GetLoanOfficerList(CurrUser.iUserID);

            DataRow NewLoanRoleRow = null;
            if (LoanRolesList.Rows.Count > 0)
            {
                NewLoanRoleRow         = LoanRolesList.NewRow();
                NewLoanRoleRow["ID"]   = 0;
                NewLoanRoleRow["Name"] = "ALL";
                LoanRolesList.Rows.InsertAt(NewLoanRoleRow, 0);
            }

            this.ddlLoanOfficer.DataSource = LoanRolesList;
            this.ddlLoanOfficer.DataBind();

            #endregion

            #region Loan Officer Assistant

            LoanRolesList = this.GetLoanRolesList("Assistant");

            if (LoanRolesList.Rows.Count > 0)
            {
                NewLoanRoleRow         = LoanRolesList.NewRow();
                NewLoanRoleRow["Name"] = "ALL";
                LoanRolesList.Rows.InsertAt(NewLoanRoleRow, 0);
            }

            this.ddlLoanOfficerAssistant.DataSource = LoanRolesList;
            this.ddlLoanOfficerAssistant.DataBind();

            #endregion

            #region Processor

            LoanRolesList = this.GetProcessorList();

            if (LoanRolesList.Rows.Count > 0)
            {
                NewLoanRoleRow         = LoanRolesList.NewRow();
                NewLoanRoleRow["ID"]   = 0;
                NewLoanRoleRow["Name"] = "ALL";
                LoanRolesList.Rows.InsertAt(NewLoanRoleRow, 0);
            }

            this.ddlProcessor.DataSource = LoanRolesList;
            this.ddlProcessor.DataBind();

            #endregion

            #region Jr Processor

            LoanRolesList = this.GetLoanRolesList("JrProcessor");

            if (LoanRolesList.Rows.Count > 0)
            {
                NewLoanRoleRow         = LoanRolesList.NewRow();
                NewLoanRoleRow["Name"] = "ALL";
                LoanRolesList.Rows.InsertAt(NewLoanRoleRow, 0);
            }

            this.ddlJrProcessor.DataSource = LoanRolesList;
            this.ddlJrProcessor.DataBind();

            #endregion

            #region Doc Prep

            LoanRolesList = this.GetLoanRolesList("DocPrep");

            if (LoanRolesList.Rows.Count > 0)
            {
                NewLoanRoleRow         = LoanRolesList.NewRow();
                NewLoanRoleRow["Name"] = "ALL";
                LoanRolesList.Rows.InsertAt(NewLoanRoleRow, 0);
            }

            this.ddlDocPrep.DataSource = LoanRolesList;
            this.ddlDocPrep.DataBind();

            #endregion

            #region Shipper

            LoanRolesList = this.GetLoanRolesList("Shipper");

            if (LoanRolesList.Rows.Count > 0)
            {
                NewLoanRoleRow         = LoanRolesList.NewRow();
                NewLoanRoleRow["Name"] = "ALL";
                LoanRolesList.Rows.InsertAt(NewLoanRoleRow, 0);
            }

            this.ddlShipper.DataSource = LoanRolesList;
            this.ddlShipper.DataBind();

            #endregion

            #region Closer

            LoanRolesList = this.GetLoanRolesList("Closer");

            if (LoanRolesList.Rows.Count > 0)
            {
                NewLoanRoleRow         = LoanRolesList.NewRow();
                NewLoanRoleRow["Name"] = "ALL";
                LoanRolesList.Rows.InsertAt(NewLoanRoleRow, 0);
            }

            this.ddlCloser.DataSource = LoanRolesList;
            this.ddlCloser.DataBind();

            #endregion

            #region Underwriter

            LoanRolesList = this.GetUnderwriterList();

            if (LoanRolesList.Rows.Count > 0)
            {
                NewLoanRoleRow         = LoanRolesList.NewRow();
                NewLoanRoleRow["ID"]   = 0;
                NewLoanRoleRow["Name"] = "ALL";
                LoanRolesList.Rows.InsertAt(NewLoanRoleRow, 0);
            }

            this.ddlUnderwriter.DataSource = LoanRolesList;
            this.ddlUnderwriter.DataBind();

            #endregion

            #endregion

            #region Lender, Referral and Loan Info

            #region Lender

            DataTable LenderList = this.GetLenderList();

            if (LenderList.Rows.Count > 0)
            {
                DataRow NewLenderRow = LenderList.NewRow();
                NewLenderRow["LenderId"] = 0;
                NewLenderRow["Lender"]   = "ALL";
                LenderList.Rows.InsertAt(NewLenderRow, 0);
            }

            this.ddlLender.DataSource = LenderList;
            this.ddlLender.DataBind();

            #endregion

            #region Program

            DataTable ProgramList = this.GetProgramList();

            if (ProgramList.Rows.Count > 0)
            {
                DataRow NewProgramRow = ProgramList.NewRow();
                NewProgramRow["Program"] = "ALL";
                ProgramList.Rows.InsertAt(NewProgramRow, 0);
            }

            this.ddlProgram.DataSource = ProgramList;
            this.ddlProgram.DataBind();

            #endregion

            #region Partner

            DataTable PartnerList = this.GetPartnerList();

            if (PartnerList.Rows.Count > 0)
            {
                DataRow NewPartnerRow = PartnerList.NewRow();
                NewPartnerRow["PartnerId"] = 0;
                NewPartnerRow["Partner"]   = "ALL";
                PartnerList.Rows.InsertAt(NewPartnerRow, 0);
            }

            this.ddlPartner.DataSource = PartnerList;
            this.ddlPartner.DataBind();

            #endregion

            #region LeadSource

            DataTable LeadSourceList = this.GetLeadSourceList();

            if (LeadSourceList.Rows.Count > 0)
            {
                DataRow NewLeadSourceRow = LeadSourceList.NewRow();
                NewLeadSourceRow["LeadSource"] = "ALL";
                LeadSourceList.Rows.InsertAt(NewLeadSourceRow, 0);
            }

            this.ddlLeadSource.DataSource = LeadSourceList;
            this.ddlLeadSource.DataBind();

            #endregion

            #region Referral

            DataTable ReferralList = this.GetReferralList();

            if (ReferralList.Rows.Count > 0)
            {
                DataRow NewReferralRow = ReferralList.NewRow();
                NewReferralRow["ReferralId"] = 0;
                NewReferralRow["Referral"]   = "ALL";
                ReferralList.Rows.InsertAt(NewReferralRow, 0);
            }

            this.ddlReferral.DataSource = ReferralList;
            this.ddlReferral.DataBind();

            #endregion

            #region Purpose

            DataTable PurposeList = this.GetPurposeList();

            if (PurposeList.Rows.Count > 0)
            {
                DataRow NewPurposeRow = PurposeList.NewRow();
                NewPurposeRow["Purpose"] = "ALL";
                PurposeList.Rows.InsertAt(NewPurposeRow, 0);
            }

            this.ddlPurpose.DataSource = PurposeList;
            this.ddlPurpose.DataBind();

            #endregion

            #endregion

            #region Current Stage

            Template_Stages Template_Stages_Mgr  = new Template_Stages();
            DataTable       Template_Stages_List = Template_Stages_Mgr.GetStageTemplateList(" and Enabled=1 order by Alias");

            if (Template_Stages_List.Rows.Count > 0)
            {
                DataRow NewStageTmplRow = Template_Stages_List.NewRow();
                NewStageTmplRow["TemplStageId"] = "0";
                NewStageTmplRow["Alias"]        = "ALL";
                Template_Stages_List.Rows.InsertAt(NewStageTmplRow, 0);
            }

            this.ddlCurrentStage.DataSource = Template_Stages_List;
            this.ddlCurrentStage.DataBind();

            #endregion

            #region Point Fields

            UserLoansViewPointFields UserLoansViewPointFields1 = new UserLoansViewPointFields();
            DataTable HeadingList = UserLoansViewPointFields1.GetUserPointFieldInfo(this.CurrUser.iUserID);

            this.rptHeading.DataSource = HeadingList;
            this.rptHeading.DataBind();

            #endregion

            //DataTable dtTaskName = new DataTable();
            //dtTaskName.Columns.Add("TaskID");
            //dtTaskName.Columns.Add("TaskName");
            //dtTaskName.Columns.Add("MatchType");
            //dtTaskName.Columns.Add("DueDateStart");
            //dtTaskName.Columns.Add("DueDateEnd");
            //dtTaskName.Columns.Add("CompDateStart");
            //dtTaskName.Columns.Add("CompDateEnd");

            //gridLicensesList.DataSource = dtTaskName;
            //gridLicensesList.DataBind();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        #region 校验页面参数

        this.sCloseDialogCodes = this.Request.QueryString["CloseDialogCodes"].ToString() + ";";

        string sMissing = "Missing required qurey string.";

        #region Action
        if (this.Request.QueryString["Action"] == null)
        {
            PageCommon.WriteJsEnd(this, sMissing, sCloseDialogCodes);
        }
        this.sAction = this.Request.QueryString["Action"].ToString();

        if (this.Request.QueryString["detail"] != null)
        {
            sParaForDetail = this.Request.QueryString["detail"].ToString();
        }


        //CR60
        Company_Point             CPMgr   = new Company_Point();
        LPWeb.Model.Company_Point CPModel = CPMgr.GetModel();
        //check if Company_Point.Enable_MultiBranchFolders=true
        //select FolderId, [Name] from PointFolders where (LoanStatus=<selected loan/lead status>) order by [Name] asc
        bool bMultBranchFolder = false;
        if (CPModel.Enable_MultiBranchFolders == true)
        {
            bMultBranchFolder = true;
        }

        if (this.Request.QueryString["ContactID"] == null)
        {
            //if (this.sAction != "Cancel" && this.sAction != "Convert"
            //&& this.sAction != "Suspend" && this.sAction != "Resume" && this.sAction != "Bad" && this.sAction != "Lost")
            //{
            //    PageCommon.WriteJsEnd(this, "Invalid query string.", sCloseDialogCodes);
            //}
        }
        else
        {
            // 如果传入ContactID,只允许Suspend/Bad/Lost操作
            if (this.sAction != "Suspend" && this.sAction != "Bad" && this.sAction != "Lost")
            {
                PageCommon.WriteJsEnd(this, "Invalid query string.", sCloseDialogCodes);
            }
        }

        #endregion

        if (this.Request.QueryString["ContactID"] == null)  // from Prospect Loan Detail→Dispose
        {
            // LoanID
            bool bIsValid = PageCommon.ValidateQueryString(this, "LoanID", QueryStringType.ID);
            if (bIsValid == false)
            {
                PageCommon.WriteJsEnd(this, sMissing, sCloseDialogCodes);
            }
            this.iLoanID = Convert.ToInt32(this.Request.QueryString["LoanID"]);

            // BranchID
            bIsValid  = PageCommon.ValidateQueryString(this, "BranchID", QueryStringType.ID);
            iBranchID = 0;
            if (bIsValid)
            {
                //PageCommon.WriteJsEnd(this, sMissing, sCloseDialogCodes);
                this.iBranchID = Convert.ToInt32(this.Request.QueryString["BranchID"]);
            }
        }
        else  // From Prospect Detail Popup→Update Point
        {
            // ContactID
            bool bIsValid = PageCommon.ValidateQueryString(this, "ContactID", QueryStringType.ID);
            if (bIsValid == false)
            {
                PageCommon.WriteJsEnd(this, sMissing, sCloseDialogCodes);
            }
            this.iContactID = Convert.ToInt32(this.Request.QueryString["ContactID"]);

            #region Get FileIDs and BranchIDs associated to ContactID

            string sSql0 = "select a.FileId, c.BranchId from LoanContacts as a inner join PointFiles as b on a.FileId=b.FileId "
                           + "inner join PointFolders as c on b.FolderId = c.FolderId "
                           + "where ContactId=" + this.iContactID + " and (ContactRoleId=dbo.lpfn_GetBorrowerRoleId() or ContactRoleId=dbo.lpfn_GetCoBorrowerRoleId())";

            this.LoanList = LPWeb.DAL.DbHelperSQL.ExecuteDataTable(sSql0);

            #endregion

            #region Build BranchIDs

            foreach (DataRow LoanRow in this.LoanList.Rows)
            {
                string sBranchID = LoanRow["BranchID"].ToString();
                if (this.sBranchIDs == string.Empty)
                {
                    this.sBranchIDs = sBranchID;
                }
                else
                {
                    this.sBranchIDs += "," + sBranchID;
                }
            }

            #endregion
        }

        #region Bug 882 若FIleName为空,不显示Point文件夹列表,更新状态,直接关闭
        sFileName = LoansManager.GetProspectFileNameInfo(this.iLoanID);

        if (sFileName == "" && this.sAction != "Convert")
        {
            #region call Workflow API: bool UpdateProspectLoanStatus(int LoanId, string newLoanStatus)
            this.form1.Visible = false;
            this.Visible       = false;
            try
            {
                string sError_UpdateProspectLoanStatus = string.Empty;
                if (this.sAction == "Resume***Active")
                {
                    this.sAction = "Active";
                }
                sError_UpdateProspectLoanStatus = WorkflowManager.UpdateProspectLoanStatus(this.iLoanID, this.sAction, this.CurrUser.iUserID);

                if (sError_UpdateProspectLoanStatus != string.Empty)
                {
                    string sFailedMsg = string.Format("Failed to update lead status (FileID={0}): {1}", this.iLoanID, sError_UpdateProspectLoanStatus);
                    // LPLog.LogMessage(LogType.Logerror, sFailedMsg);
                    PageCommon.WriteJsEnd(this, sFailedMsg, sCloseDialogCodes);
                    //PageCommon.WriteJsEnd(this, sFailedMsg, PageCommon.Js_RefreshSelf);
                }
            }
            catch (Exception ex)
            {
                string sExMsg = string.Format("Failed to dispose of the lead, status (FileID={0}): {1}", this.iLoanID, ex.Message);
                // LPLog.LogMessage(LogType.Logerror, sExMsg);

                throw;
            }

            #endregion

            PageCommon.WriteJsEnd(this, "Disposed of the lead successfully.", "window.parent.location.href=window.parent.location.href;");
        }
        #endregion

        #endregion

        #region 加载Point Folder List

        string sWhere = "1=1";
        if (iBranchID <= 0 && iLoanID > 0)
        {
            string SqlCmd = string.Format("Select BranchId from Loans where FileId={0}", iLoanID);
            object obj    = LPWeb.DAL.DbHelperSQL.GetSingle(SqlCmd);
            iBranchID = obj == null ? 0 : (int)obj;
            if (iBranchID <= 0)
            {
                string SqlCmd_01     = string.Format("Select dbo.[lpfn_GetLoanOfficerID]({0})", iLoanID);
                object obj_01        = LPWeb.DAL.DbHelperSQL.GetSingle(SqlCmd_01);
                int    LoanOfficerId = obj_01 == null ? 0 : (int)obj_01;
                if (LoanOfficerId > 0)
                {
                    string SqlCmd_02 = string.Format("Select b.BranchId from GroupUsers bu inner join Branches b on bu.GroupId=b.GroupId where bu.UserId={0} ", LoanOfficerId);
                    object obj_02    = LPWeb.DAL.DbHelperSQL.GetSingle(SqlCmd_02);
                    iBranchID = obj_02 == null ? 0 : (int)obj_02;
                }
            }
        }
        //if (iBranchID <= 0)
        //{
        //    PageCommon.WriteJsEnd(this, "Cannot find the branch for the selected lead; no Point folders found.", sCloseDialogCodes);
        //}
        if (this.Request.QueryString["ContactID"] == null)
        {
            #region  入LoanID和BranchID
            if (bMultBranchFolder == false)
            {
                if (iBranchID > 0)
                {
                    sWhere += " and BranchId=" + this.iBranchID;
                }
            }
            if (sAction == "Convert")  // 特殊
            {
                sWhere += " and LoanStatus=1 and Enabled=1";
            }
            else if (sAction == "Resume***Active")
            {
                sWhere += " and LoanStatus=6 and Enabled=1 "; // sWhere1; bug 970 应弹出“Prospect“的文件夹列表(PointFolders.LoanStatus=6)
            }
            else
            {
                sWhere += " and LoanStatus=8 "; // sWhere1;
            }

            #endregion
        }
        else // 传入ContactID
        {
            // Suspend/Bad/Lost 筛选条件相同
            if (bMultBranchFolder == false)
            {
                if (!string.IsNullOrEmpty(this.sBranchIDs))
                {
                    sWhere += " and BranchId in (" + this.sBranchIDs + ") ";
                }
            }

            sWhere += " and LoanStatus<>1 and LoanStatus<>6 ";
        }
        PointFolders PointFolderManager  = new PointFolders();
        string       orderby             = "  Order By Name ";
        DataTable    PointFolderListData = PointFolderManager.GetList(sWhere + orderby).Tables[0];
        if (PointFolderListData.Rows.Count == 0)
        {
            this.form1.Visible = false;
            this.Visible       = false;
            string folderType = string.IsNullOrEmpty(this.sAction) || this.sAction.Trim().ToUpper() != "CONVERT" ? "Archived Leads " : "Active Loans";
            string err        = string.Format("No {0} folder available.", folderType);
            PageCommon.WriteJsEnd(this, err, sCloseDialogCodes);
        }
        this.gridPointFolderList.DataSource = PointFolderListData;
        this.gridPointFolderList.DataBind();

        #endregion

        #region If Company_Point.MasterSource=’DataTrac’
        Company_Point _bCompany_Point = new Company_Point();
        DataTable     dt = _bCompany_Point.GetCompany_PointInfo();
        if (dt.Rows.Count > 0)
        {
            sShowSubmitLoanPopup = dt.Rows[0]["MasterSource"].ToString() == "DataTrac" ? "1" : "0";
        }
        #endregion

        #region sFileName

        sFileName = LoansManager.GetProspectFileNameInfo(this.iLoanID);

        #endregion
    }
Exemple #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);
    }
Exemple #11
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            #region set Default
            if (!string.IsNullOrEmpty(hifId.Value))
            {
                bool IsCancel = false;

                var val = hifId.Value.Split(':');

                if (val.Count() != 2)
                {
                    return;
                }
                IsCancel = Convert.ToBoolean(val[1]);

                PointFolders folder = new PointFolders();
                folder.SetDefaultPoint(val[0], this.iBranchID, IsCancel);
            }

            #endregion

            bool   bEnabled   = this.ckbEnabled.Checked;
            string sDesc      = this.txbDescription.Text.Trim();
            string sFolderIDs = this.hdnFolderIDs.Value;
            string sManagers  = this.hdnManagers.Value;


            LPWeb.Model.Branches model = new LPWeb.Model.Branches();
            model = branchManager.GetModel(iBranchID);
            int iOldGroupID = Convert.ToInt32(model.GroupID);
            model.BranchId = iBranchID;
            model.Enabled  = ckbEnabled.Checked;
            model.Desc     = txbDescription.Text.Trim();
            model.Name     = ddlBranchName.SelectedItem.Text;
            if (ddlGroupAccess.Items.Count > 0)
            {
                model.GroupID = int.Parse(ddlGroupAccess.SelectedValue);
            }
            else
            {
                model.GroupID = 0;
            }
            model.BranchAddress = txbAddress.Text.Trim();
            model.City          = txbCity.Text.Trim();
            model.Zip           = txbZip.Text.Trim();
            model.BranchState   = ddlState.SelectedValue.Trim();

            if (this.fuldWebLogo.HasFile && this.fuldWebLogo.FileName.ToUpper().IndexOf(".TIF") < 0)
            {
                model.WebsiteLogo = fuldWebLogo.FileBytes;
            }
            else
            {
                model.WebsiteLogo = null;
            }
            model.License1 = txbLicense1.Text.Trim();
            model.License2 = txbLicense2.Text.Trim();
            model.License3 = txbLicense3.Text.Trim();
            model.License4 = txbLicense4.Text.Trim();
            model.License5 = txbLicense5.Text.Trim();

            model.Disclaimer = txbDisclaimer.Text.Trim();

            model.Phone  = txbPhone.Text.Trim();
            model.Fax    = txbFax.Text.Trim();
            model.Email  = txbEmail.Text.Trim();
            model.WebURL = txbWebURL.Text.Trim();

            var oldHomeBranch = model.HomeBranch;
            model.HomeBranch = chkHomeBranch.Checked;


            try
            {
                if (oldHomeBranch != model.HomeBranch)
                {
                    branchManager.SetOtherHomeBranchFalse(model.BranchId);
                }
                branchManager.SaveBranchAndMembersBase(model, sFolderIDs, sManagers);
                //Save point folder enable status
                PointFolders pointFolderMgr = new PointFolders();
                if (this.hdnDisableFolderIDs.Value.Trim() != "")
                {
                    pointFolderMgr.UpdatePointFolderEnabled(this.hdnDisableFolderIDs.Value, false);
                }
                if (this.hdnEnableFolderIDs.Value.Trim() != "")
                {
                    pointFolderMgr.UpdatePointFolderEnabled(this.hdnEnableFolderIDs.Value, true);
                }
                //this.divManager.SaveDivisionAndMembersBase(this.iDivisionID, bEnabled, sDesc, sBranchMemberIDs, sExectives);
                //Save group folder info
                model = branchManager.GetModel(model.BranchId);
                GroupFolder groupFolder = new GroupFolder();
                if (model.GroupID != 0)
                {
                    groupFolder.DoSaveGroupFolder(Convert.ToInt32(model.GroupID), model.BranchId, "branch", iOldGroupID);
                }

                if (model.RegionID != 0 && model.RegionID != null)
                {
                    Regions             regMgr      = new Regions();
                    LPWeb.Model.Regions regionModel = regMgr.GetModel(Convert.ToInt32(model.RegionID));
                    if (regionModel.GroupID != null && regionModel.GroupID != 0)
                    {
                        groupFolder.DoSaveGroupFolder(Convert.ToInt32(regionModel.GroupID), Convert.ToInt32(model.RegionID), "region", Convert.ToInt32(regionModel.GroupID));
                    }
                }
                if (model.DivisionID != 0 && model.DivisionID != null)
                {
                    Divisions             divMgr   = new Divisions();
                    LPWeb.Model.Divisions divModel = divMgr.GetModel(Convert.ToInt32(model.DivisionID));
                    if (divModel.GroupID != null && divModel.GroupID != 0)
                    {
                        groupFolder.DoSaveGroupFolder(Convert.ToInt32(divModel.GroupID), Convert.ToInt32(model.DivisionID), "division", Convert.ToInt32(divModel.GroupID));
                    }
                }
                PageCommon.WriteJsEnd(this, "Branch saved successfully.", PageCommon.Js_RefreshSelf);
            }
            catch
            {
                PageCommon.WriteJsEnd(this, "Failed to save the record.", PageCommon.Js_RefreshSelf);
            }
        }
Exemple #12
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;
            }
        }