Esempio n. 1
0
        /// <summary>
        ///  Import LoanContacts
        /// </summary>
        /// <param name="iFileId"></param>
        /// <param name="iContactID"></param>
        /// <param name="RoleID"></param>
        private void ImportLoanContacts(int iFileId, int iContactID, int RoleID)
        {
            LoanContacts bLoanContacts = new LoanContacts();

            Model.LoanContacts mLoanContacts = new Model.LoanContacts();
            mLoanContacts.FileId        = iFileId;
            mLoanContacts.ContactId     = iContactID;
            mLoanContacts.ContactRoleId = RoleID;
            bLoanContacts.Add(mLoanContacts);
        }
 protected void btnRemove_Click(object sender, EventArgs e)
 {
     try
     {
         string       ContactIDs = this.hfContactIDs.Value;
         LoanContacts lc         = new LoanContacts();
         lc.DeleteLoanContacts(CurrentFileId, ContactIDs);
         BindGrid(1);
     }
     catch
     { }
 }
Esempio n. 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         string       Contacts = "Contract" + iContactID.ToString() + "_" + iContactRoleID.ToString();
         LoanContacts lc       = new LoanContacts();
         lc.DeleteLoanContacts(CurrentFileId, Contacts);
         PageCommon.WriteJs(this, "Deleted Loan Contact successfully.", "  window.parent.location.href=window.parent.location.href;");
     }
     catch
     {
     }
 }
Esempio n. 4
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (this.CurrentFileId == 0)
        {
            return;
        }
        int ContactID = 0;

        LPWeb.Model.Contacts model = new LPWeb.Model.Contacts();
        try
        {
            ContactID = int.Parse(hfdContactID.Value);
            Contacts contact = new Contacts();
            model = contact.GetModel(ContactID);
        }
        catch
        { }

        ServiceManager sm = new ServiceManager();

        using (LP2ServiceClient service = sm.StartServiceClient())
        {
            ReassignContactRequest req = new ReassignContactRequest();
            req.hdr = new ReqHdr();
            req.hdr.SecurityToken = "SecurityToken"; //todo:check dummy data
            req.hdr.UserId        = CurrentUser.iUserID;
            ReassignContactInfo        cInfo = new ReassignContactInfo();
            List <ReassignContactInfo> cList = new List <ReassignContactInfo>();
            cInfo.FileId        = this.CurrentFileId;//todo:check dummy data
            cInfo.ContactRoleId = int.Parse(ddlContactRole.SelectedValue);
            cInfo.NewContactId  = ContactID;
            cList.Add(cInfo);
            req.reassignContacts = cList.ToArray();
            ReassignContactResponse respone = null;
            try
            {
                respone = service.ReassignContact(req);
                if (respone.hdr.Successful)
                {
                    LPWeb.Model.LoanContacts lcModel = new LPWeb.Model.LoanContacts();
                    lcModel.FileId        = CurrentFileId;
                    lcModel.ContactRoleId = cInfo.ContactRoleId;
                    lcModel.ContactId     = ContactID;

                    LPWeb.Model.LoanContacts oldlcModel = new LPWeb.Model.LoanContacts();
                    oldlcModel.FileId        = CurrentFileId;
                    oldlcModel.ContactRoleId = oldRoleID;
                    oldlcModel.ContactId     = oldContactID;

                    LPWeb.BLL.LoanContacts lc = new LoanContacts();

                    lc.Reassign(oldlcModel, lcModel, req.hdr.UserId);
                    try
                    {
                        PageCommon.WriteJsEnd(this, "Reassigned contact successfully", PageCommon.Js_RefreshParent);
                    }
                    catch
                    { }
                }
                else
                {
                    try
                    {
                        PageCommon.WriteJsEnd(this, String.Format("Failed to reassign contact: reason: {0}.", respone.hdr.StatusInfo), PageCommon.Js_RefreshSelf);
                    }
                    catch
                    { }
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException ex)
            {
                LPLog.LogMessage(ex.Message);
                PageCommon.WriteJsEnd(this, "Failed to reassign contact: reason, Point Manager is not running. ", PageCommon.Js_RefreshSelf);
            }
            catch (Exception exception)
            {
                LPLog.LogMessage(exception.Message);
                PageCommon.WriteJsEnd(this, String.Format("Failed to reassign contact, reason: {0}", exception.Message), PageCommon.Js_RefreshSelf);
            }
        }
    }
Esempio n. 5
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);
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["FileID"] == null && Request.QueryString["ContactID"] != null)
        {
            var ContactID = string.IsNullOrEmpty(Request.QueryString["ContactID"]) ? 0 : Convert.ToInt32(Request.QueryString["ContactID"]);
            LPWeb.BLL.LoanContacts loancontacts = new LoanContacts();
            var ds = loancontacts.GetContactLoans(ContactID);

            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
            {
                iFileID = (ds.Tables[0].Rows[0]["FileId"] == DBNull.Value || ds.Tables[0].Rows[0]["FileId"].ToString() == "") ? 0 : Convert.ToInt32(ds.Tables[0].Rows[0]["FileId"]);
            }
            else
            {
                iFileID = 0;
            }
        }
        else
        {
            iFileID = Request.QueryString["FileID"] == null ? 0 : Convert.ToInt32(Request.QueryString["FileID"]);
        }
        CheckPointFileStatusReq  req  = new CheckPointFileStatusReq();
        CheckPointFileStatusResp resp = new CheckPointFileStatusResp();

        try
        {
            ServiceManager sm = new ServiceManager();
            using (LP2ServiceClient service = sm.StartServiceClient())
            {
                req.FileId = iFileID;
                req.hdr    = new ReqHdr()
                {
                    UserId = loginUser.iUserID
                };

                resp = service.CheckPointFileStatus(req);

                if (resp == null || resp.hdr == null)
                {
                    Write(false, "Err : CheckPointFileStatusResp is NULL");
                    return;
                }
                if (resp.FileLocked)
                {
                    Write(false, resp.hdr.StatusInfo);
                }
                else
                {
                    Write(true, "");
                }
            }
        }
        catch (System.ServiceModel.EndpointNotFoundException)
        {
            string sExMsg = string.Format("Failed to sync data from Point. Reason: Point Manager is not running.");
            LPLog.LogMessage(LogType.Logerror, sExMsg);
            Write(false, sExMsg);
        }
        catch (Exception ex)
        {
            string sExMsg = string.Format("error: {0}", ex.Message);
            LPLog.LogMessage(LogType.Logerror, sExMsg);

            Write(false, sExMsg);
        }
    }
Esempio n. 7
0
    protected void btnSelect_Click(object sender, EventArgs e)
    {
        int iNewContactID = Convert.ToInt32(this.hdnSelContactID.Value);

        #region 加载LoanContacts

        string    sSql       = "select * from LoanContacts where ContactID=" + this.iDelContactID;
        DataTable RefLoanIDs = LPWeb.DAL.DbHelperSQL.ExecuteDataTable(sSql);

        #endregion

        #region 调用PointManager.ReassignContactRequest

        ServiceManager sm = new ServiceManager();
        using (LP2ServiceClient service = sm.StartServiceClient())
        {
            #region Build ReassignContactRequest

            ReassignContactRequest req = new ReassignContactRequest();
            req.hdr = new ReqHdr();
            req.hdr.SecurityToken = "SecurityToken"; //todo:check dummy data
            req.hdr.UserId        = this.CurrUser.iUserID;

            List <ReassignContactInfo> ContactList = new List <ReassignContactInfo>();
            foreach (DataRow RefLoanRow in RefLoanIDs.Rows)
            {
                int iFileID        = Convert.ToInt32(RefLoanRow["FileId"]);
                int iContactRoleID = Convert.ToInt32(RefLoanRow["ContactRoleId"]);

                ReassignContactInfo ContactInfo = new ReassignContactInfo();
                ContactInfo.FileId        = iFileID;
                ContactInfo.ContactRoleId = iContactRoleID;
                ContactInfo.NewContactId  = iNewContactID;
                ContactList.Add(ContactInfo);
            }
            req.reassignContacts = ContactList.ToArray();

            #endregion

            ReassignContactResponse respone = null;
            try
            {
                respone = service.ReassignContact(req);

                if (respone.hdr.Successful)
                {
                    foreach (DataRow RefLoanRow in RefLoanIDs.Rows)
                    {
                        int iFileID        = Convert.ToInt32(RefLoanRow["FileId"]);
                        int iContactRoleID = Convert.ToInt32(RefLoanRow["ContactRoleId"]);

                        #region Reassign Loan Contact

                        LPWeb.Model.LoanContacts lcModel = new LPWeb.Model.LoanContacts();
                        lcModel.FileId        = iFileID;
                        lcModel.ContactRoleId = iContactRoleID;
                        lcModel.ContactId     = iNewContactID;

                        LPWeb.Model.LoanContacts oldlcModel = new LPWeb.Model.LoanContacts();
                        oldlcModel.FileId        = iFileID;
                        oldlcModel.ContactRoleId = iContactRoleID;
                        oldlcModel.ContactId     = this.iDelContactID;

                        LPWeb.BLL.LoanContacts lc = new LoanContacts();
                        lc.Reassign(oldlcModel, lcModel, req.hdr.UserId);

                        #endregion

                        #region delete contact

                        Contacts bllContact = new Contacts();
                        int      iUserType  = 0;
                        if (this.CurrUser.bIsCompanyExecutive)
                        {
                            iUserType = 0;
                        }
                        else if (this.CurrUser.bIsBranchManager)
                        {
                            iUserType = 1;
                        }
                        else
                        {
                            iUserType = 2;
                        }
                        bllContact.PartnerContactsDelete(this.iDelContactID, CurrUser.iUserID, iUserType);

                        #endregion
                    }

                    PageCommon.WriteJsEnd(this, "Deleted contact successfully", PageCommon.Js_RefreshParent);
                }
                else
                {
                    PageCommon.WriteJsEnd(this, String.Format("Failed to reassign contact: reason: {0}.", respone.hdr.StatusInfo), PageCommon.Js_RefreshSelf);
                }
            }
            catch (System.ServiceModel.EndpointNotFoundException ex)
            {
                LPLog.LogMessage(ex.Message);
                PageCommon.WriteJsEnd(this, "Failed to reassign contact: reason, Point Manager is not running. ", PageCommon.Js_RefreshSelf);
            }
            catch (Exception exception)
            {
                LPLog.LogMessage(exception.Message);
                PageCommon.WriteJsEnd(this, String.Format("Failed to reassign contact, reason: {0}", exception.Message), PageCommon.Js_RefreshSelf);
            }
        }

        #endregion
    }