Esempio n. 1
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Update(LPWeb.Model.Prospect model)
        {
            int rowsAffected = 0;

            SqlParameter[] parameters =
            {
                new SqlParameter("@ContactId",        SqlDbType.Int),
                new SqlParameter("@LeadSource",       SqlDbType.NVarChar,  255),
                new SqlParameter("@ReferenceCode",    SqlDbType.NVarChar,  255),
                new SqlParameter("@Referral",         SqlDbType.NVarChar,  255),
                new SqlParameter("@Created",          SqlDbType.DateTime),
                new SqlParameter("@CreatedBy",        SqlDbType.Int),
                new SqlParameter("@Modifed",          SqlDbType.DateTime),
                new SqlParameter("@ModifiedBy",       SqlDbType.Int),
                new SqlParameter("@Loanofficer",      SqlDbType.Int),
                new SqlParameter("@Status",           SqlDbType.NVarChar,   50),
                new SqlParameter("@CreditRanking",    SqlDbType.NVarChar,   50),
                new SqlParameter("@PreferredContact", SqlDbType.NVarChar, 50)
            };
            parameters[0].Value  = model.Contactid;
            parameters[1].Value  = model.LeadSource;
            parameters[2].Value  = model.ReferenceCode;
            parameters[3].Value  = model.Referral;
            parameters[4].Value  = model.Created;
            parameters[5].Value  = model.CreatedBy;
            parameters[6].Value  = model.Modifed;    // Modified
            parameters[7].Value  = model.ModifiedBy; // ModifiedBy
            parameters[8].Value  = model.Loanofficer;
            parameters[9].Value  = model.Status;
            parameters[10].Value = model.CreditRanking;
            parameters[11].Value = model.PreferredContact;

            DbHelperSQL.RunProcedure("dbo.Prospect_Save", parameters, out rowsAffected);
            return(true);
        }
Esempio n. 2
0
        /// <summary>
        /// create contact and prospect without checking duplicated
        /// neo 2012-10-24
        /// </summary>
        /// <param name="contactInfo"></param>
        /// <param name="prospectInfo"></param>
        /// <returns></returns>
        public int CreateContactAndProspectNoCheck(LPWeb.Model.Contacts contactInfo, LPWeb.Model.Prospect prospectInfo)
        {
            int iContactId = -1;

            if (contactInfo == null || (prospectInfo == null))
            {
                throw new Exception("CreateProspect, ContactInfo and ProspectInfo cannot be empty.");
            }

            if (string.IsNullOrEmpty(contactInfo.LastName) || string.IsNullOrEmpty(contactInfo.FirstName))
            {
                throw new Exception("CreateProspect, First Name and Last Name cannot be blank.");
            }
            if (string.IsNullOrEmpty(contactInfo.Email) && string.IsNullOrEmpty(contactInfo.HomePhone) && string.IsNullOrEmpty(contactInfo.CellPhone) &&
                string.IsNullOrEmpty(contactInfo.BusinessPhone))
            {
                throw new Exception("CreateProspect, must at least specified Email, Home Phone, Cell Phone or Business Phone.");
            }

            Contacts contactMgr = new Contacts();

            iContactId = contactMgr.AddClientNoCheck(contactInfo);
            if (iContactId > 0)
            {
                Prospect prospectMgr = new Prospect();
                prospectInfo.Contactid = iContactId;
                prospectMgr.Add(prospectInfo);
            }
            return(iContactId);
        }
Esempio n. 3
0
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List <LPWeb.Model.Prospect> DataTableToList(DataTable dt)
        {
            List <LPWeb.Model.Prospect> modelList = new List <LPWeb.Model.Prospect>();
            int rowsCount = dt.Rows.Count;

            if (rowsCount > 0)
            {
                LPWeb.Model.Prospect model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = new LPWeb.Model.Prospect();
                    if (dt.Rows[n]["Contactid"].ToString() != "")
                    {
                        model.Contactid = int.Parse(dt.Rows[n]["Contactid"].ToString());
                    }
                    model.LeadSource    = dt.Rows[n]["LeadSource"].ToString();
                    model.ReferenceCode = dt.Rows[n]["ReferenceCode"].ToString();
                    if (dt.Rows[n]["Referral"] != DBNull.Value)
                    {
                        model.Referral = Convert.ToInt32(dt.Rows[n]["Referral"]);
                    }
                    else
                    {
                        model.Referral = null;
                    }
                    if (dt.Rows[n]["Created"].ToString() != "")
                    {
                        model.Created = DateTime.Parse(dt.Rows[n]["Created"].ToString());
                    }
                    if (dt.Rows[n]["CreatedBy"].ToString() != "")
                    {
                        model.CreatedBy = int.Parse(dt.Rows[n]["CreatedBy"].ToString());
                    }
                    if (dt.Rows[n]["Modifed"].ToString() != "")
                    {
                        model.Modifed = DateTime.Parse(dt.Rows[n]["Modifed"].ToString());
                    }
                    if (dt.Rows[n]["ModifiedBy"].ToString() != "")
                    {
                        model.ModifiedBy = int.Parse(dt.Rows[n]["ModifiedBy"].ToString());
                    }
                    if (dt.Rows[n]["Loanofficer"].ToString() != "")
                    {
                        model.Loanofficer = int.Parse(dt.Rows[n]["Loanofficer"].ToString());
                    }
                    model.Status = dt.Rows[n]["Status"].ToString();
                    modelList.Add(model);
                }
            }
            return(modelList);
        }
Esempio n. 4
0
    protected int CreateContactAndProspect(string sFirstName, string sLastName, string sEmail, string sType, string sPhone, string sDOB, string sSSN, int iUserID, string Purpose)
    {
        #region create new contact

        LPWeb.Model.Contacts ContactsModel = new LPWeb.Model.Contacts();
        ContactsModel.ContactId = 0;
        ContactsModel.FirstName = sFirstName;
        ContactsModel.LastName  = sLastName;
        ContactsModel.Email     = sEmail;

        if (sType == "Cell Phone")
        {
            ContactsModel.CellPhone     = sPhone;
            ContactsModel.HomePhone     = string.Empty;
            ContactsModel.BusinessPhone = string.Empty;
        }
        else if (sType == "Home Phone")
        {
            ContactsModel.CellPhone     = string.Empty;
            ContactsModel.HomePhone     = sPhone;
            ContactsModel.BusinessPhone = string.Empty;
        }
        else if (sType == "Work Phone")
        {
            ContactsModel.CellPhone     = string.Empty;
            ContactsModel.HomePhone     = string.Empty;
            ContactsModel.BusinessPhone = sPhone;
        }

        if (sDOB == string.Empty)
        {
            ContactsModel.DOB = null;
        }
        else
        {
            ContactsModel.DOB = Convert.ToDateTime(sDOB);
        }

        ContactsModel.SSN = sSSN;

        ContactsModel.MiddleName     = string.Empty;
        ContactsModel.NickName       = txtFirstName.Text.Trim();
        ContactsModel.Title          = string.Empty;
        ContactsModel.GenerationCode = string.Empty;
        ContactsModel.Fax            = string.Empty;
        ContactsModel.MailingAddr    = string.Empty;
        ContactsModel.MailingCity    = string.Empty;
        ContactsModel.MailingState   = string.Empty;
        ContactsModel.MailingZip     = string.Empty;

        #endregion

        #region create new prospect

        LPWeb.Model.Prospect ProspectModel = new LPWeb.Model.Prospect();

        ProspectModel.PreferredContact = sType;

        ProspectModel.Contactid  = 0;
        ProspectModel.Created    = DateTime.Now;
        ProspectModel.CreatedBy  = iUserID;
        ProspectModel.LeadSource = ddlLeadSource.SelectedValue.ToString() == "0" ? "" : this.ddlLeadSource.SelectedItem.Text;

        string sLoanOfficerID = ddlLoanOfficer.SelectedValue;
        iLoanOfficerID = 0;
        if (sLoanOfficerID == "-1" || sLoanOfficerID == "-2")
        {
            //Nobody
        }
        else if (sLoanOfficerID == "0")
        {
            //Lead Routing Engine
            try
            {
                ServiceManager sm = new ServiceManager();
                using (LP2ServiceClient client = sm.StartServiceClient())
                {
                    //invoke the WCF API GetNextLoanOfficer
                    LR_GetNextLoanOfficerReq req = new LR_GetNextLoanOfficerReq();
                    req.LeadSource           = ddlLeadSource.SelectedItem.Text;
                    req.Purpose              = Purpose;
                    req.ReqHdr               = new ReqHdr();
                    req.ReqHdr.UserId        = CurrUser.iUserID;
                    req.ReqHdr.SecurityToken = "SecurityToken";
                    LR_GetNextLoanOfficerResp response = client.LeadRouting_GetNextLoanofficer(req);
                    if (response.RespHdr.Successful)
                    {
                        iLoanOfficerID = response.NextLoanOfficerID;
                    }
                    else
                    {
                        Company_Lead_Sources LeadSourceMgr     = new Company_Lead_Sources();
                        DataTable            SelLeadSourceList = LeadSourceMgr.GetList("LeadSourceID='" + ddlLeadSource.SelectedValue + "'").Tables[0];
                        if (SelLeadSourceList != null && SelLeadSourceList.Rows.Count > 0)
                        {
                            iLoanOfficerID = SelLeadSourceList.Rows[0]["DefaultUserId"] == DBNull.Value ? 0 : Convert.ToInt32(SelLeadSourceList.Rows[0]["DefaultUserId"]);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Company_Lead_Sources LeadSourceMgr     = new Company_Lead_Sources();
                DataTable            SelLeadSourceList = LeadSourceMgr.GetList("LeadSourceID='" + ddlLeadSource.SelectedValue + "'").Tables[0];
                if (SelLeadSourceList != null && SelLeadSourceList.Rows.Count > 0)
                {
                    iLoanOfficerID = SelLeadSourceList.Rows[0]["DefaultUserId"] == DBNull.Value ? 0 : Convert.ToInt32(SelLeadSourceList.Rows[0]["DefaultUserId"]);
                }
            }
        }
        else
        {
            iLoanOfficerID = Convert.ToInt32(sLoanOfficerID);
        }


        ProspectModel.Loanofficer   = iLoanOfficerID;
        ProspectModel.ReferenceCode = string.Empty;
        ProspectModel.Status        = "Active";
        ProspectModel.CreditRanking = string.Empty;
        ProspectModel.Referral      = null;

        Prospect ProspectManager = new Prospect();

        int iContactId = ProspectManager.CreateContactAndProspect(ContactsModel, ProspectModel);


        #endregion

        return(iContactId);
    }
Esempio n. 5
0
    private void FillLabels()
    {
        if (iContactID == 0)
        {
            return;
        }
        try
        {
            LPWeb.BLL.Contacts   contact = new LPWeb.BLL.Contacts();
            LPWeb.Model.Contacts cModel  = contact.GetModel(iContactID);
            lbClient.Text   = cModel.LastName + ", " + cModel.FirstName + " " + cModel.MiddleName;
            lbNikeName.Text = cModel.NickName;
            if (cModel.DOB.HasValue)
            {
                lbDOB.Text = cModel.DOB.Value.ToShortDateString();
            }
            else
            {
                lbDOB.Text = string.Empty;
            }
            lbGenCode.Text = cModel.GenerationCode;
            lbSSN.Text     = cModel.SSN;
            lbTitle.Text   = cModel.Title;
            if (cModel.Experian.HasValue)
            {
                lbExperScore.Text = cModel.Experian.Value.ToString();
            }
            if (cModel.TransUnion.HasValue)
            {
                lbTranScore.Text = cModel.TransUnion.Value.ToString();
            }
            if (cModel.Equifax.HasValue)
            {
                lbEquifax.Text = cModel.Equifax.Value.ToString();
            }
            lbHomePhone.Text     = cModel.HomePhone;
            lbCellPhone.Text     = cModel.CellPhone;
            lbBusinessPhone.Text = cModel.BusinessPhone;
            lbFax.Text           = cModel.Fax;
            lbEmail.Text         = cModel.Email;
            lbAddress.Text       = cModel.MailingAddr;
            lbAddress1.Text      = cModel.MailingCity + ", " + cModel.MailingState + " " + cModel.MailingZip;
        }
        catch
        { }
        try
        {
            LPWeb.BLL.Prospect   prospect = new LPWeb.BLL.Prospect();
            LPWeb.Model.Prospect pModel   = prospect.GetModel(iContactID);
            lbStatus.Text     = pModel.Status;
            lbLeadSource.Text = pModel.LeadSource;//Get referral contact name
            if (pModel.Loanofficer.HasValue)
            {
                lbLoanOfficer.Text = GetUserName(pModel.Loanofficer.Value);
            }
            if (pModel.Created.HasValue)
            {
                lbCreatedOn.Text = pModel.Created.Value.ToShortDateString();
            }
            if (pModel.CreatedBy.HasValue)
            {
                lbCreatedBy.Text = GetUserName(pModel.CreatedBy.Value);
            }
            if (pModel.Modifed.HasValue)
            {
                lbLastModified.Text = pModel.Modifed.Value.ToShortDateString();
            }
            if (pModel.ModifiedBy.HasValue)
            {
                lbModifiedBy.Text = GetUserName(pModel.ModifiedBy.Value);
            }

            int iReferralId = 0;

            if (pModel.Referral != null)
            {
                iReferralId = (int)pModel.Referral;

                LPWeb.BLL.Contacts contact = new LPWeb.BLL.Contacts();
                lbReferral.Text = contact.GetContactName(iReferralId);
            }

            this.lbPreferredContact.Text = pModel.PreferredContact;
            this.lbCreditRanking.Text    = pModel.CreditRanking;
        }
        catch
        { }
    }
Esempio n. 6
0
    private int Save_LoanDetail()
    {
        ReassignProspect();

        #region gdc crm33
        int    iContactCoBoId = string.IsNullOrEmpty(hdnCoBorrowerID.Value) ? 0 : Convert.ToInt32(hdnCoBorrowerID.Value);
        string CBname         = txtCBFirstname.Text + txtCBMiddlename.Text + txtCBLastname.Text;

        if ((CBname != hdnCoBorrowerName.Value.Trim() || iContactCoBoId == 0) && !string.IsNullOrEmpty(CBname))
        {
            LPWeb.Model.Contacts contactRecCoBo = new LPWeb.Model.Contacts();
            Contacts             contactsbll    = new Contacts();//gdc crm33
            contactRecCoBo.ContactId  = 0;
            contactRecCoBo.FirstName  = txtCBFirstname.Text.Trim();
            contactRecCoBo.MiddleName = txtCBMiddlename.Text.Trim();
            contactRecCoBo.LastName   = txtCBLastname.Text.Trim();

            iContactCoBoId = contactsbll.AddClient(contactRecCoBo);//gdc crm33

            #region CoBo to loanContacts  gdc crm33
            LPWeb.BLL.LoanContacts loanContactsBll = new LoanContacts();


            LPWeb.BLL.ContactRoles contactRolesbll = new ContactRoles();
            int contactRoleID   = 0;
            var contactRoleList = contactRolesbll.GetModelList(" Name = 'CoBorrower' ");
            if (contactRoleList != null && contactRoleList.Count > 0 && contactRoleList.FirstOrDefault() != null)
            {
                contactRoleID = contactRoleList.FirstOrDefault().ContactRoleId;
            }

            if (contactRoleID != 0)
            {
                LPWeb.Model.LoanContacts loanContactModel = new LPWeb.Model.LoanContacts();
                loanContactModel.FileId        = iFileID;
                loanContactModel.ContactRoleId = contactRoleID;
                loanContactModel.ContactId     = iContactCoBoId;

                loanContactsBll.Add(loanContactModel);
            }

            #endregion
        }
        #endregion

        LPWeb.Model.LoanDetails model = new LPWeb.Model.LoanDetails();
        model.FileId = iFileID;
        if (ddlBorrower.Items.Count < 1)
        {
            model.BoID = 0;
        }
        else
        {
            model.BoID = int.Parse(ddlBorrower.SelectedValue);
        }
        //if (ddlCoBorrower.Items.Count < 1)
        //{
        //    model.CoBoID = 0;
        //}
        //else
        //{
        //    model.CoBoID = int.Parse(ddlCoBorrower.SelectedValue);
        //}

        if (iContactCoBoId != 0)
        {
            model.CoBoID = iContactCoBoId;
        }


        model.Created    = DateTime.Now;
        model.CreatedBy  = loginUser.iUserID;
        model.Modifed    = DateTime.Now;
        model.ModifiedBy = loginUser.iUserID;
        if (txbAmount.Text.Trim().Length < 1)
        {
            model.LoanAmount = 0;
        }
        else
        {
            model.LoanAmount = decimal.Parse(txbAmount.Text.Trim());
        }

        if (txbEstimatedDate.Text.Trim().Length > 5)
        {
            model.EstCloseDate = DateTime.Parse(txbEstimatedDate.Text.Trim());
        }
        else
        {
            model.EstCloseDate = DateTime.Parse("1900-1-1");
        }
        if (ddlRanking.SelectedIndex >= 0)
        {
            model.Ranking = ddlRanking.SelectedValue;
        }
        model.UserId = CurrUser.iUserID;
        if (ddlLoanOfficer.Items.Count < 1)
        {
            model.LoanOfficerId = 0;
        }
        else
        {
            model.LoanOfficerId = int.Parse(ddlLoanOfficer.SelectedValue);
        }
        if (txbInterestRate.Text.Trim().Length < 1)
        {
            model.Rate = 0;
        }
        else
        {
            model.Rate = decimal.Parse(txbInterestRate.Text.Trim());
        }

        if (ddlLoanProgram.SelectedIndex == 0)
        {
            model.Program = "";
        }
        else
        {
            model.Program = ddlLoanProgram.SelectedItem.Text;
        }
        if (ddlPurpose.SelectedIndex == 0)
        {
            model.Purpose = "";
        }
        else
        {
            model.Purpose = ddlPurpose.SelectedItem.Text.Trim();
        }

        model.Lien          = ddlLienPosition.SelectedItem.Value.Trim();
        model.PropertyAddr  = txbPropertyAddress.Text.Trim();
        model.PropertyCity  = txbCity.Text.Trim();
        model.PropertyState = ddlState.SelectedValue;
        model.PropertyZip   = txbZip.Text.Trim();
        if (ddlPointFolder.Items.Count < 1)
        {
            model.FolderId = 0;
        }
        else
        {
            model.FolderId = int.Parse(ddlPointFolder.SelectedValue);
        }
        model.FileName           = txbPointFileName.Text.Trim();
        model.Status             = "Prospect";
        model.ProspectLoanStatus = "Active";

        model.PropertyType   = txbPropetyType.Text.Trim();
        model.HousingStatus  = txbHousingStatus.Text.Trim();
        model.IncludeEscrows = cbIncludeEscrows.Checked;
        model.InterestOnly   = cbInterestOnly.Checked;
        model.RentAmount     = string.IsNullOrEmpty(txbRentAmount.Text.Trim()) ? 0 : Convert.ToDecimal(txbRentAmount.Text.Trim());
        model.CoborrowerType = txbCoborrowerType.Text.Trim();
        iFileID = loan.LoanDetailSaveFileId(model);


        #region Referral
        LPWeb.Model.Prospect modelProspect = new LPWeb.Model.Prospect();

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

        modelProspect.LeadSource = ddlLeadSource.SelectedValue; //gdc CR40

        int referralIDNew = string.IsNullOrEmpty(hdnReferralID.Value.Trim()) ? 0 : Convert.ToInt32(hdnReferralID.Value.Trim());

        if (referralIDNew > 0 && referralIDNew.ToString() != modelProspect.Referral.ToString())
        {
            int referralIDOld = modelProspect.Referral == null ? 0 : Convert.ToInt32(modelProspect.Referral);

            modelProspect.Referral = referralIDNew;

            #region Referral to loanContacts  gdc crm33
            LPWeb.BLL.LoanContacts loanContactsBll = new LoanContacts();

            LPWeb.BLL.ContactRoles contactRolesbll = new ContactRoles();
            int refrralRoleID    = 0;
            var referralRoleList = contactRolesbll.GetModelList(" Name = 'Referral' ");
            if (referralRoleList != null && referralRoleList.Count > 0 && referralRoleList.FirstOrDefault() != null)
            {
                refrralRoleID = referralRoleList.FirstOrDefault().ContactRoleId;
            }

            if (refrralRoleID != 0)
            {
                LPWeb.Model.LoanContacts loanContactModel = new LPWeb.Model.LoanContacts();
                loanContactModel.FileId        = iFileID;
                loanContactModel.ContactRoleId = refrralRoleID;
                loanContactModel.ContactId     = referralIDNew;

                loanContactsBll.Add(loanContactModel);
            }

            #endregion


            #region Del Old loanContacts

            try
            {
                if (referralIDOld > 0)
                {
                    loanContactsBll.Delete(iFileID, refrralRoleID, referralIDOld);
                }
            }
            catch { }

            #endregion
        }

        bllProspect.Update(modelProspect); //gdc CR40

        #endregion

        return(iFileID);
    }
Esempio n. 7
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;
    }
Esempio n. 8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        #region 校验页面参数

        string sReturnUrl = "../Pipeline/ProspectPipelineSummary.aspx";
        string sErrorMsg  = "Failed to load this page: missing required query string.";
        string sBackJs    = "window.location.href='" + sReturnUrl + "'";

        // e
        bool bIsValid = PageCommon.ValidateQueryString(this, "e", QueryStringType.String);
        if (bIsValid == false)
        {
            PageCommon.WriteJsEnd(this, sErrorMsg, sBackJs);
        }
        string sEncodeQueryString = this.Request.QueryString["e"];
        string sDecodeQueryString = Encrypter.Base64Decode(sEncodeQueryString);

        bIsValid = Regex.IsMatch(sDecodeQueryString, @"^ContactID=([1-9]\d*)&ContactIDs=([1-9]\d*)(,[1-9]\d*)*$");
        if (bIsValid == false)
        {
            PageCommon.WriteJsEnd(this, sErrorMsg, sBackJs);
        }

        string[] QueryStringArray = sDecodeQueryString.Split('&');

        string sContactIDKeyValue  = QueryStringArray[0];
        string sContactIDsKeyValue = QueryStringArray[1];

        string[] ContactIDKeyValueArray  = sContactIDKeyValue.Split('=');
        string[] ContactIDsKeyValueArray = sContactIDsKeyValue.Split('=');

        // ContactID
        string sContactID = ContactIDKeyValueArray[1];

        // ContactIDs
        string sContactIDs = ContactIDsKeyValueArray[1];

        // PageFrom
        bIsValid = PageCommon.ValidateQueryString(this, "PageFrom", QueryStringType.String);
        if (bIsValid == false)
        {
            PageCommon.WriteJsEnd(this, sErrorMsg, sBackJs);
        }
        string sPageFrom = this.Request.QueryString["PageFrom"];
        if (sPageFrom == string.Empty)
        {
            sPageFrom = sReturnUrl;
        }

        #endregion

        hfID.Value       = sContactID;
        hfIDs.Value      = sContactIDs;
        hfPageFrom.Value = sPageFrom;

        #region AccessUnassignedLeads check

        LPWeb.BLL.Prospect prospect = new LPWeb.BLL.Prospect();

        LPWeb.Model.Prospect pModel = prospect.GetModel(Convert.ToInt32(sContactID));

        //当 有loanOfficer 指定  或者
        if (pModel != null && (pModel.Loanofficer == null || pModel.Loanofficer == 0 || pModel.Loanofficer == -1))
        {
            if (!CurrUser.bAccessOtherLoans && !CurrUser.userRole.AccessUnassignedLeads)
            {
                PageCommon.WriteJsEnd(this, "No permission to access", sBackJs);
            }
        }

        #endregion
    }
Esempio n. 9
0
    protected int CreateContactAndProspect(string sFirstName, string sLastName, string sEmail, string sCellPhone, string sHomePhone,
                                           string sWorkPhone, string sDOB, string sSSN,
                                           string sDependants, string sCreditRanking, string sFICO,
                                           string sMailingStreetAddress1, string sMailingStreetAddress2, string sMailingCity, string sMailingState, string sMailingZip,
                                           string sLeadSource, string sReferralID)
    {
        #region create new contact

        LPWeb.Model.Contacts ContactsModel = new LPWeb.Model.Contacts();
        ContactsModel.ContactId = 0;
        ContactsModel.FirstName = sFirstName;
        ContactsModel.LastName  = sLastName;
        ContactsModel.Email     = sEmail;

        ContactsModel.CellPhone     = sCellPhone;
        ContactsModel.HomePhone     = sHomePhone;
        ContactsModel.BusinessPhone = sWorkPhone;

        if (sDOB == string.Empty)
        {
            ContactsModel.DOB = null;
        }
        else
        {
            ContactsModel.DOB = Convert.ToDateTime(sDOB);
        }

        ContactsModel.SSN = sSSN;

        if (sFICO == string.Empty)
        {
            ContactsModel.Experian = null;
        }
        else
        {
            ContactsModel.Experian = Convert.ToInt32(sFICO);
        }

        ContactsModel.MailingAddr  = (sMailingStreetAddress1 + " " + sMailingStreetAddress2).Trim();
        ContactsModel.MailingCity  = sMailingCity;
        ContactsModel.MailingState = sMailingState;
        ContactsModel.MailingZip   = sMailingZip;

        ContactsModel.Created   = DateTime.Now;
        ContactsModel.CreatedBy = this.CurrUser.iUserID;

        ContactsModel.MiddleName     = string.Empty;
        ContactsModel.NickName       = sFirstName;
        ContactsModel.Title          = string.Empty;
        ContactsModel.GenerationCode = string.Empty;
        ContactsModel.Fax            = string.Empty;


        #endregion

        #region create new prospect

        LPWeb.Model.Prospect ProspectModel = new LPWeb.Model.Prospect();

        ProspectModel.Contactid  = 0;
        ProspectModel.LeadSource = sLeadSource;
        if (sReferralID == string.Empty)
        {
            ProspectModel.Referral = null;
        }
        else
        {
            ProspectModel.Referral = Convert.ToInt32(sReferralID);
        }
        ProspectModel.CreditRanking = sCreditRanking;
        ProspectModel.Created       = DateTime.Now;
        ProspectModel.CreatedBy     = this.CurrUser.iUserID;
        ProspectModel.Status        = "Active";
        if (sDependants == "Yes")
        {
            ProspectModel.Dependents = true;
        }
        else
        {
            ProspectModel.Dependents = false;
        }

        ProspectModel.Modifed          = null;
        ProspectModel.ModifiedBy       = null;
        ProspectModel.Loanofficer      = null;
        ProspectModel.ReferenceCode    = null;
        ProspectModel.PreferredContact = null;

        #endregion

        int iContactId = this.ProspectMgr.CreateContactAndProspect(ContactsModel, ProspectModel);

        return(iContactId);
    }
Esempio n. 10
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 public bool Update(LPWeb.Model.Prospect model)
 {
     return(dal.Update(model));
 }
Esempio n. 11
0
 /// <summary>
 /// create contact and prospect without checking duplicated
 /// neo 2012-10-24
 /// </summary>
 /// <param name="contactInfo"></param>
 /// <param name="prospectInfo"></param>
 /// <returns></returns>
 public int CreateContactAndProspectNoCheck(LPWeb.Model.Contacts contactInfo, LPWeb.Model.Prospect prospectInfo)
 {
     return(dal.CreateContactAndProspectNoCheck(contactInfo, prospectInfo));
 }
Esempio n. 12
0
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public int Add(LPWeb.Model.Prospect model)
 {
     return(dal.Add(model));
 }