示例#1
0
    protected void btnDelete_Click(object sender, EventArgs e)
    {
        try
        {
            LPWeb.BLL.Prospect prospect = new LPWeb.BLL.Prospect();
            prospect.Delete(iContactID);
        }
        catch (Exception ex)
        {
            string sExMsg = string.Format("Failed to delete the prospect, error:{0}", ex.Message);
            LPLog.LogMessage(LogType.Logerror, sExMsg);
            PageCommon.WriteJsEnd(this, sExMsg, PageCommon.Js_RefreshSelf);
        }

        PageCommon.WriteJsEnd(this, "Delete prospect successfully.", "window.parent.parent.location.href='../Pipeline/ProspectPipelineSummary.aspx'");
    }
示例#2
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
        { }
    }
示例#3
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
    }