Exemplo n.º 1
0
    protected void lbtnSendWeekly_Click(object sender, EventArgs e)
    {
        try
        {
            string   ContactIDs    = this.hfContactIDs.Value;
            string[] Ids           = ContactIDs.Split(",".ToCharArray());
            string   ReturnMessage = string.Empty;
            foreach (string cid in Ids)
            {
                string ContactID = string.Empty;
                if (cid.Contains("User"))
                {
                    ContactID = cid.Replace("User", "");

                    LPWeb.BLL.Users blluser = new LPWeb.BLL.Users();
                    var             userMod = blluser.GetModel(int.Parse(ContactID));

                    if (string.IsNullOrEmpty(userMod.EmailAddress))
                    {
                        PageCommon.AlertMsg(this, "The selected recipient " + userMod.LastName + "," + userMod.FirstName + " does not have an email address.");
                        return;
                    }

                    UpdateEmailSettings(0, int.Parse(ContactID), 2, true, 1);
                }
                else if (cid.Contains("Contract"))
                {
                    ContactID = cid.Replace("Contract", "");

                    LPWeb.BLL.Contacts bllcontacts = new LPWeb.BLL.Contacts();
                    var contactMod = bllcontacts.GetModel(int.Parse(ContactID));
                    if (string.IsNullOrEmpty(contactMod.Email))
                    {
                        PageCommon.AlertMsg(this, "The selected recipient " + contactMod.LastName + "," + contactMod.FirstName + " does not have an email address.");
                        return;
                    }

                    UpdateEmailSettings(int.Parse(ContactID), 0, 2, true, 1);
                }
            }

            PageCommon.WriteJsEnd(this, "The report has been scheduled successfully!", PageCommon.Js_RefreshSelf);
        }
        catch (Exception ex)
        {
            PageCommon.AlertMsg(this, "The operation is Failed .");
            LPLog.LogMessage(LogType.Logerror, "Failed to schedule the report , exception: " + ex.Message);

            PageCommon.WriteJsEnd(this, "Failed to schedule the report, error:" + ex.Message, PageCommon.Js_RefreshSelf);
        }
    }
    /// <summary>
    /// update Contacts.UpdatePoint= 0 or 1
    /// neo 2011-03-13
    /// </summary>
    /// <param name="iContactID"></param>
    /// <param name="bUpdatePoint"></param>
    private void UpdatePoint(int iContactID, bool bUpdatePoint)
    {
        LPWeb.BLL.Contacts ContactManager = new LPWeb.BLL.Contacts();

        try
        {
            ContactManager.UpdatePoint(iContactID, false);
        }
        catch (Exception ex)
        {
            string sExMsg = string.Format("Failed to update the client record (ContactID={0}): {1}", iContactID, ex.Message);
            LPLog.LogMessage(LogType.Logerror, sExMsg);
        }
    }
    protected void btnvCardExport_Click(object sender, EventArgs e)
    {
        // 加载BorrowerInfo
        DataTable BorrowerInfo = this.GetBorrowerInfo(this.iLoanID);

        if (BorrowerInfo.Rows.Count == 0)
        {
            PageCommon.WriteJsEnd(this, "There is no borrower for this lead.", PageCommon.Js_RefreshSelf);
        }
        int iContactID = Convert.ToInt32(BorrowerInfo.Rows[0]["ContactId"]);

        string sCurrentPagePath = this.Server.MapPath("~/");
        string sFileName        = Guid.NewGuid().ToString();
        string sFilePath        = Path.Combine(Path.GetDirectoryName(sCurrentPagePath), sFileName);

        #region #region Call vCardToString(ContactId, true) API

        LPWeb.BLL.Contacts x           = new LPWeb.BLL.Contacts();
        string             sContactStr = x.vCardToString(iContactID, true);

        #endregion

        // save file
        if (File.Exists(sFilePath) == false)
        {
            // Create a file to write to.
            using (StreamWriter sw = File.CreateText(sFilePath))
            {
                sw.Write(sContactStr);
            }
        }

        FileInfo FileInfo1 = new FileInfo(sFilePath);
        this.Response.Clear();
        this.Response.ClearHeaders();
        this.Response.Buffer      = false;
        this.Response.ContentType = "application/octet-stream";
        this.Response.AppendHeader("Content-Disposition", "attachment;filename=vcard.vcf");
        this.Response.AppendHeader("Content-Length", FileInfo1.Length.ToString());
        this.Response.WriteFile(sFilePath);
        this.Response.Flush();

        // 删除临时文件
        File.Delete(sFilePath);

        this.Response.End();
    }
Exemplo n.º 4
0
    protected void btnSaveAsVCard_Click(object sender, EventArgs e)
    {
        string sCurrentPagePath = this.Server.MapPath("~/");
        string sFileName        = Guid.NewGuid().ToString();
        string sFilePath        = Path.Combine(Path.GetDirectoryName(sCurrentPagePath), sFileName);

        #region #region Call vCardToString(ContactId, true) API

        LPWeb.BLL.Contacts x           = new LPWeb.BLL.Contacts();
        string             sContactStr = x.vCardToString(this.iContactID, true);

        #endregion

        // save file
        //if (File.Exists(sFilePath) == false)
        //{
        //    // Create a file to write to.
        //    using (StreamWriter sw = File.CreateText(sFilePath))
        //    {
        //        sw.Write(sContactStr);
        //    }
        //}

        //FileInfo FileInfo1 = new FileInfo(sFilePath);

        this.Response.Clear();
        this.Response.ClearHeaders();
        this.Response.Buffer      = false;
        this.Response.ContentType = "application/octet-stream";
        this.Response.AppendHeader("Content-Disposition", "attachment;filename=vcard.vcf");
        //this.Response.AppendHeader("Content-Length", FileInfo1.Length.ToString());
        //this.Response.WriteFile(sFilePath);

        this.Response.AppendHeader("Content-Length", sContactStr.Length.ToString());
        this.Response.Write(sContactStr);
        this.Response.Flush();

        // 删除临时文件
        //File.Delete(sFilePath);

        this.Response.End();
    }
Exemplo n.º 5
0
    protected void lbtnSendNow_Click(object sender, EventArgs e)
    {
        try
        {
            string   ContactIDs    = this.hfContactIDs.Value;
            string[] Ids           = ContactIDs.Split(",".ToCharArray());
            string   ReturnMessage = string.Empty;
            foreach (string cid in Ids)
            {
                int  ContactID = 0;
                bool External  = true;
                if (cid.Contains("User"))
                {
                    ContactID = int.Parse(cid.Replace("User", ""));
                    LPWeb.BLL.Users blluser = new LPWeb.BLL.Users();
                    var             userMod = blluser.GetModel(ContactID);

                    if (string.IsNullOrEmpty(userMod.EmailAddress))
                    {
                        PageCommon.AlertMsg(this, "The selected recipient " + userMod.LastName + "," + userMod.FirstName + " does not have an email address.");
                        return;
                    }

                    External       = true;
                    ReturnMessage += SendLSREmail(0, string.Empty, string.Empty, ContactID, userMod.EmailAddress, userMod.FirstName + " " + userMod.LastName, External, null);
                    //ReturnMessage = SendExternalReport(0,ContactID, External);
                }
                else if (cid.Contains("Contract"))
                {
                    ContactID = int.Parse(cid.Replace("Contract", ""));

                    LPWeb.BLL.Contacts bllcontacts = new LPWeb.BLL.Contacts();
                    var contactMod = bllcontacts.GetModel(ContactID);
                    if (string.IsNullOrEmpty(contactMod.Email))
                    {
                        PageCommon.AlertMsg(this, "The selected recipient " + contactMod.LastName + "," + contactMod.FirstName + " does not have an email address.");
                        return;
                    }


                    External       = true;
                    ReturnMessage += SendLSREmail(ContactID, contactMod.Email, contactMod.FirstName + ' ' + contactMod.LastName, 0, string.Empty, string.Empty, External, null);
                    //ReturnMessage = SendExternalReport(ContactID,0, External);
                }

                if (string.IsNullOrEmpty(ReturnMessage))
                {
                    PageCommon.AlertMsg(this, "The report has been sent successfully!");
                }
                else
                {
                    PageCommon.AlertMsg(this, "Failed to send the report, error:" + ReturnMessage);
                    return;
                }
            }
        }
        catch (Exception ex)
        {
            PageCommon.AlertMsg(this, "Failed to disable the selected contact role(s).");
            LPLog.LogMessage(LogType.Logerror, "Failed to disable the selected contact role(s), exception: " + ex.Message);
            PageCommon.AlertMsg(this, "Failed to send the report, error:" + ex.Message);
        }
    }
Exemplo n.º 6
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
        { }
    }