Exemple #1
0
        public async Task <ResponseData> PostContactAsync(ProspectInfo prospect)
        {
            var response      = SendEmail(prospect);
            var storeResponse = await StoreProspectInfo(prospect);

            return(response);
        }
Exemple #2
0
        private async Task <ResponseData> StoreProspectInfo(ProspectInfo prospect)
        {
            try
            {
                DAL.Prospect newProspect = Mapper.Map <DAL.Prospect>(prospect);
                _prospectRepo.Insert(newProspect);
                await _prospectRepo.Commit();

                return(new ResponseData()
                {
                    success = true,
                    message = "Message successfully sent!"
                });
            }
            catch (Exception e)
            {
                string errorMessage = string.Format("Error in method: {0} | Exception type: {1} | Message: {2} | StackTrace: {3}", System.Reflection.MethodBase.GetCurrentMethod(),
                                                    e.GetType(), e.Message, e.StackTrace);

                return(new ResponseData()
                {
                    message = errorMessage,
                    success = false
                });
            }
        }
    public override void UpdateOverviewPage()
    {
        base.UpdateOverviewPage();

        Jobcentre jc = (Jobcentre)obj;

        //update prospect list ONLY if there's different # of prospects than before
        if (prospectGrid.childCount == jc.Prospects.Count)
        {
            return;
        }

        foreach (Transform child in prospectGrid)
        {
            Destroy(child.gameObject);
        }

        //instantiate worker list
        foreach (Prole p in jc.Prospects)
        {
            if (p == null)
            {
                continue;
            }

            GameObject go = Instantiate(UIObjectDatabase.GetUIElement("ProspectInfo"));
            go.transform.SetParent(prospectGrid);

            ProspectInfo pi = go.GetComponent <ProspectInfo>();
            pi.prospect  = p;
            pi.jobcentre = jc;
        }
    }
Exemple #4
0
        public void ContactForm(ProspectInfo p)
        {
            /* There is no look up table for Contact Results because they are hardcoded into the form for actually adding a contact to a record
             * Another Setting is used to allow for customization of the blank Contact Form.  It is called "ContactFormResults"
             * The code takes a semi-colon seperated string stored in ContactFormResults and converts it to a list.
             * If ContactFormResults does not exist in Settings then the default list is used.
             *
             * However, because the results are hardcoded, there will be no translation between the results on this form and the results on the Contact page itself.
             * We will implement extra values for this table to accomodate this at some point.
             * */
            var           Db            = DbUtil.Db;
            List <string> ContactResult =
                Db.Setting(
                    "ContactFormResults",
                    "Not at Home;Left Door Hanger;Left Message;Contact Made;Gospel Shared;Profession of Faith;Prayer Request Rec'd;Prayed for Person;Already Saved"
                    ).Split(';').ToList();

            doc.NewPage();

            var t = new PdfPTable(2);

            t.SetNoBorder();
            t.AddCentered("InReach/Outreach Card for {0} ({1})".Fmt(p.Name, p.PeopleId), 2, h1font);
            t.AddCentered("Contact Summary", 2, h2font);
            /* Added line for noting the Ministry recording the contact*/
            t.AddLeft("Ministry: ______________________", 1, bfont);
            t.AddRight("Contact Date: _______________", 1, bfont);

            doc.Add(t);

            var ContactReason = Db.ContactReasons.Select(rr => rr.Description).Take(10).ToList();
            var ContactType   = Db.ContactTypes.Select(rr => rr.Description).Take(10).ToList();

            DisplayTable("Contact Reason", 5.7f, 1.2f, 24.2f, ContactReason);
            DisplayTable("Type of Contact", 5.7f, 8f, 24.2f, ContactType);
            DisplayTable("Results", 5.7f, 14.5f, 24.2f, ContactResult);

            DisplayNotes("Team Members", 3, 6f, 13.7f, 6.5f);
            DisplayNotes("Specific Comments on Contact", 5, 18.5f, 1.2f, 13f);
            DisplayTable("Actions to be taken", 12f, 1f, 6.5f, new List <string>
            {
                "Recycle to me on ____/____/____",
                "Random Recycle",
                "Follow-up Completed",
                "Other Action:___________________________________",
            });

            var t2 = new PdfPTable(1);

            t2.TotalWidth = 7.5f * 72f;
            t2.SetNoBorder();
            t2.LockedWidth = true;
            t2.AddCentered("Internal Use Only", 1, smallfont);
            t2.WriteSelectedRows(0, -1, 36f, 56f, dc);
        }
Exemple #5
0
        public void ContactForm(ProspectInfo p)
        {
            /* There is no look up table for Contact Results because they are hardcoded into the form for actually adding a contact to a record
             * Another Setting is used to allow for customization of the blank Contact Form.  It is called "ContactFormResults"
             * The code takes a semi-colon seperated string stored in ContactFormResults and converts it to a list.
             * If ContactFormResults does not exist in Settings then the default list is used.
             *
             * However, because the results are hardcoded, there will be no translation between the results on this form and the results on the Contact page itself.
             * We will implement extra values for this table to accomodate this at some point.
             * */
            var Db = DbUtil.Db;
            List<string> ContactResult =
                Db.Setting(
                "ContactFormResults",
                "Not at Home;Left Door Hanger;Left Message;Contact Made;Gospel Shared;Profession of Faith;Prayer Request Rec'd;Prayed for Person;Already Saved"
                ).Split(';').ToList();

            doc.NewPage();

            var t = new PdfPTable(2);

            t.SetNoBorder();
            t.AddCentered("InReach/Outreach Card for {0} ({1})".Fmt(p.Name, p.PeopleId), 2, h1font);
            t.AddCentered("Contact Summary", 2, h2font);
            /* Added line for noting the Ministry recording the contact*/
            t.AddLeft("Ministry: ______________________", 1, bfont);
            t.AddRight("Contact Date: _______________", 1, bfont);

            doc.Add(t);

            var ContactReason = Db.ContactReasons.Select(rr => rr.Description).Take(10).ToList();
            var ContactType = Db.ContactTypes.Select(rr => rr.Description).Take(10).ToList();

            DisplayTable("Contact Reason", 5.7f, 1.2f, 24.2f, ContactReason);
            DisplayTable("Type of Contact", 5.7f, 8f, 24.2f, ContactType);
            DisplayTable("Results", 5.7f, 14.5f, 24.2f, ContactResult);

            DisplayNotes("Team Members", 3, 6f, 13.7f, 6.5f);
            DisplayNotes("Specific Comments on Contact", 5, 18.5f, 1.2f, 13f);
            DisplayTable("Actions to be taken", 12f, 1f, 6.5f, new List<string>
            {
                "Recycle to me on ____/____/____",
                "Random Recycle",
                "Follow-up Completed",
                "Other Action:___________________________________",
            });

            var t2 = new PdfPTable(1);
            t2.TotalWidth = 7.5f * 72f;
            t2.SetNoBorder();
            t2.LockedWidth = true;
            t2.AddCentered("Internal Use Only", 1, smallfont);
            t2.WriteSelectedRows(0, -1, 36f, 56f, dc);
        }
Exemple #6
0
        private EDDY.IS.LeadPing.Domain.ProspectInfo TransLateToInternalProspect(ProspectInfo ProspectInfo)
        {
            try
            {
                EDDY.IS.LeadPing.Domain.ProspectInfo ReturnValue = new EDDY.IS.LeadPing.Domain.ProspectInfo();
                ReturnValue.AddressLine2        = ProspectInfo.AddressLine2;
                ReturnValue.Age                 = ProspectInfo.Age;
                ReturnValue.City                = ProspectInfo.City;
                ReturnValue.CountryID           = ProspectInfo.CountryID;
                ReturnValue.EducationLevelID    = ProspectInfo.EducationLevelID;
                ReturnValue.MilitaryAffiliation = ProspectInfo.MilitaryAffiliation;
                ReturnValue.MilitaryStatusId    = ProspectInfo.MilitaryStatusId;
                ReturnValue.ExternalLeadId      = ProspectInfo.ExternalLeadId;
                ReturnValue.Email               = ProspectInfo.Email;
                ReturnValue.FirstName           = ProspectInfo.FirstName;
                ReturnValue.LastName            = ProspectInfo.LastName;
                ReturnValue.Phone1              = ProspectInfo.Phone1;
                ReturnValue.HighSchoolGradYear  = ProspectInfo.HighSchoolGradyear;
                if (ProspectInfo.Phone2 == null)
                {
                    ReturnValue.Phone2 = ProspectInfo.Phone1;
                }
                else if (ProspectInfo.Phone2.Length == 0)
                {
                    ReturnValue.Phone2 = ProspectInfo.Phone1;
                }
                else
                {
                    ReturnValue.Phone2 = ProspectInfo.Phone2;
                }

                ReturnValue.StateID          = ProspectInfo.StateID;
                ReturnValue.ZipCode          = ProspectInfo.ZipCode;
                ReturnValue.StreetAddress    = ProspectInfo.StreetAddress;
                ReturnValue.AddressLine2     = ProspectInfo.AddressLine2;
                ReturnValue.DesiredStartDate = ProspectInfo.DesiredStartDate;

                return(ReturnValue);
            }
            catch (Exception Ex)
            {
                ISException isEx = new ISException(Ex,
                                                   MethodBase.GetCurrentMethod().DeclaringType.Namespace
                                                   + "." + MethodBase.GetCurrentMethod().DeclaringType.Name
                                                   + "." + MethodBase.GetCurrentMethod().Name, ProspectInfo);
                isEx.Save(true);
                throw Ex;
            }
        }
Exemple #7
0
        private ResponseData SendEmail(ProspectInfo prospect)
        {
            try
            {
                SmtpClient mailer = new SmtpClient();
                mailer.Host = "mail." + Request.RequestUri.Host.Substring(0, 3) == "www" ? Request.RequestUri.Host.Substring(4) : Request.RequestUri.Host;
                mailer.UseDefaultCredentials = false;
                //Removed NetworkCredential for security purposes
                MailMessage mail = new MailMessage(ConfigurationManager.AppSettings["EmailContactOrigin"], ConfigurationManager.AppSettings["EmailContactReceiver"]);

                mail.Priority   = MailPriority.High;
                mail.Subject    = "New Prospect: " + prospect.Service;
                mail.IsBodyHtml = true;

                StringBuilder sb = new StringBuilder();
                sb.Append("<p><strong>Customer Name: </strong>" + prospect.Name + "</p>");
                sb.Append("<p><strong>Service Needed: </strong>" + prospect.Service + "</p>");
                sb.Append("<p><strong>Message: </strong></p>");
                sb.AppendLine("<pre style='font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: black;'>" + prospect.Message + "</pre> <br />");
                sb.Append("<span style='font-size:14px;'>Respond to customer: <br/>Email - " + prospect.Email + " <br/> Phone - <a href='tel:+1" + prospect.Phone + "'>" + prospect.Phone + "</a></span>");

                mail.Body = sb.ToString();
                mailer.Send(mail);

                return(new ResponseData()
                {
                    success = true,
                    message = "Message successfully sent!"
                });
            }
            catch (Exception e)
            {
                string errorMessage = string.Format("Error in method: {0} | Exception type: {1} | Message: {2} | StackTrace: {3}", System.Reflection.MethodBase.GetCurrentMethod(),
                                                    e.GetType(), e.Message, e.StackTrace);
                //Log.Error(errorMessage);
                return(new ResponseData()
                {
                    success = false,
                    message = errorMessage
                });
            }
        }
Exemple #8
0
 public bool Equals(ProspectInfo other)
 {
     return(X == other.X && Z == other.Z);
 }
Exemple #9
0
        private String GetValidationErrorMessage(ProspectInfo ProspectInfo)
        {
            try
            {
                if (ProspectInfo.Age == 0)
                {
                    return("Age must be greater than zero");
                }

                if (ProspectInfo.City == null)
                {
                    return("City is required");
                }
                if (ProspectInfo.City.Length == 0)
                {
                    return("A City value is required");
                }


                if (ProspectInfo.CountryID == 0)
                {
                    return("An I.S. system country ID value is required");
                }

                if (ProspectInfo.EducationLevelID == 0)
                {
                    return("An I.S. system Education Level ID value is required");
                }

                if (ProspectInfo.Email == null)
                {
                    return("Email is required");
                }
                if (ProspectInfo.Email.Length == 0)
                {
                    return("A value for Email is required");
                }

                if (ProspectInfo.FirstName == null)
                {
                    return("FirstName is required");
                }
                if (ProspectInfo.FirstName.Length == 0)
                {
                    return("A value for FirstName is required");
                }

                if (ProspectInfo.LastName == null)
                {
                    return("LastName is required");
                }
                if (ProspectInfo.LastName.Length == 0)
                {
                    return("A value for LastName is required");
                }

                if (ProspectInfo.Phone1 == null)
                {
                    return("Phone1 is required");
                }

                if (ProspectInfo.HighSchoolGradyear == 0)
                {
                    return("High School Grad year is required");
                }


                if (ProspectInfo.Phone1.Length == 0)
                {
                    return("A value for Phone1 is required");
                }

                if (ProspectInfo.StateID == 0)
                {
                    return("An I.S. system State ID value is required");
                }

                if (ProspectInfo.ZipCode == null)
                {
                    return("ZipCode is required");
                }
                if (ProspectInfo.ZipCode.Length == 0)
                {
                    return("A value for ZipCode is required");
                }

                if (ProspectInfo.StreetAddress == null)
                {
                    return("StreetAddress is required");
                }

                if (ProspectInfo.StreetAddress.Length == 0)
                {
                    return("A value for StreetAddress is required");
                }
            }
            catch (Exception Ex)
            {
                ISException isEx = new ISException(Ex,
                                                   MethodBase.GetCurrentMethod().DeclaringType.Namespace
                                                   + "." + MethodBase.GetCurrentMethod().DeclaringType.Name
                                                   + "." + MethodBase.GetCurrentMethod().Name, ProspectInfo);
                isEx.Save(true);
                throw Ex;
            }


            return(null);
        }