Exemplo n.º 1
0
 public LeadAssembler(Contact contact, LeadPersonal leadPersonal, Telesale telesale, LeadFactory factory)
 {
     Contact = contact;
     LeadPersonal = leadPersonal;
     Telesale = telesale;
     LeadFactory = factory;
 }
Exemplo n.º 2
0
 public override ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale)
 {
     LeadAssembler.Contact = contact;
     LeadAssembler.LeadPersonal = person;
     LeadAssembler.Telesale = telesale;
     contact.Leads.Add(LeadAssembler.Assemble(BusinessTypes.Cleaning));
     return ScriptActionResult.Completed | ScriptActionResult.EmailRequired;
 }
Exemplo n.º 3
0
        public override ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale)
        {
            if (contact == null || contact.ContactPerson == null)
                return ScriptActionResult.InCompeleted;

            contact.ContactPerson.Email = Email;
            return ScriptActionResult.Completed;
        }
Exemplo n.º 4
0
        public override ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale)
        {
            if (contact == null || contact.Site == null)
                return ScriptActionResult.InCompeleted;

            contact.Site.Qualification = Number;
            return ScriptActionResult.Completed;
        }
Exemplo n.º 5
0
        public override ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale)
        {
            if (contact.CallLines == null)
                return ScriptActionResult.InCompeleted;

            var callLine = contact.CallLines.Last();
            callLine.EmailInfo = true;
            return ScriptActionResult.Completed;
        }
Exemplo n.º 6
0
        public override ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale)
        {
            if (contact == null || !contact.CallFrequency.HasValue)
                return ScriptActionResult.InCompeleted;

            if (UpdateInMonth)
                contact.NextCall = DateTime.Today.AddMonths(contact.CallFrequency.Value);
            else
                contact.NextCall = DateTime.Today.AddDays(3*7);

            return ScriptActionResult.Completed;
        }
Exemplo n.º 7
0
        public override ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale)
        {
            if (string.IsNullOrEmpty(Firstname) && string.IsNullOrEmpty(Lastname))
                return ScriptActionResult.InCompeleted;

            if (contact == null || contact.ContactPerson == null)
                return ScriptActionResult.InCompeleted;

            contact.ContactPerson.Firstname = Firstname;
            contact.ContactPerson.Lastname = Lastname;
            return ScriptActionResult.Completed;
        }
Exemplo n.º 8
0
        public override ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale)
        {
            var group = contact.Site.Groups.SingleOrDefault(x => x.Type == "Building");
            if (group == null)
                throw new Exception("No property manager building found for this site");

            throw new NotImplementedException();
            //todo need to re-do on this
            /*if (!string.IsNullOrEmpty(Firstname) || !string.IsNullOrEmpty(Lastname))
            {
                group.Firstname = Firstname;
                group.Lastname = Lastname;
            }

            if (!string.IsNullOrEmpty(Phone))
                group.Phone = Phone;

            if (!string.IsNullOrEmpty(Company))
                group.AgentComp = Company;*/
        }
Exemplo n.º 9
0
        public override ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale)
        {
            Lead lead;

            LeadAssembler.Contact = contact;
            LeadAssembler.LeadPersonal = person;
            LeadAssembler.Telesale = telesale;

            switch (Type)
            {
                case ScriptActionType.CreateMaintenanceLead:
                    lead = LeadAssembler.Assemble(BusinessTypes.Maintenance);
                    break;
                default:
                    lead = LeadAssembler.Assemble(BusinessTypes.Cleaning);
                    break;
            }

            contact.Leads.Add(lead);

            return ScriptActionResult.Completed | ScriptActionResult.EmailRequired;
        }
Exemplo n.º 10
0
        public override ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale)
        {
            if (site == null)
                throw new Exception("This site cant not be changed to OPR, please contact DB admin");

            if (site.Contacts.Any(x=>x.Code == "OPR"))
                throw new Exception("Not a valid tenant, the site already has an OPR contact");

            site.PropertyManaged = false;
            site.TsToCall = true;
            site.Size = Size.Size025.ToString();

            contact.DaToCheck = true;
            contact.DaToCheckInfo = "Need new tenant for PMS";

            site.Contacts.Add(new Contact
            {
                SiteId = site.Id,
                BusinessTypeId = (int)BusinessTypes.Cleaning,
                LastCall = DateTime.Today,
                NextCall = DateTime.Today.AddDays(contact.CallFrequency.GetValueOrDefault() * 7),
                Code = "OPR",
                CallFrequency = 3,
                ContactPerson = new ContactPerson
                {
                    SiteId = site.Id,
                    Lastname = Lastname,
                    Firstname = Firstname,
                    DirectLine = Phone,
                    Mobile = Mobile,
                    CreateDate = DateTime.Today
                }
            });

            return ScriptActionResult.Completed;
        }
Exemplo n.º 11
0
 public BdScriptProvider(Contact contact, LeadPersonal leadPerson)
 {
     Contact = contact;
     LeadPerson = leadPerson;
 }
Exemplo n.º 12
0
        private bool OverOccupyLimit(LeadPersonal leadPerson, out IList<int> occupiedList)
        {
            occupiedList = UnitOfWork.OccupiedContactRepository.Filter(x => x.LeadPersonalId == leadPerson.Id, x => x.ContactId);
            if (occupiedList.Any() && occupiedList.Count >= leadPerson.GetLeadsLeftToGet())
                return true;

            return false;
        }
Exemplo n.º 13
0
 public override ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale)
 {
     contact.CallBackDate = CallbackDate;
     return ScriptActionResult.Completed;
 }
Exemplo n.º 14
0
        /// <summary>
        /// update the qp lead priority
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public IHttpActionResult Put(LeadPersonal model)
        {
            if (!ModelState.IsValid)
                return BadRequest(ModelState);

            return Ok(new
            {
                data = _leadPersonalService.Update(model)
            });
        }
Exemplo n.º 15
0
 public abstract ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale);
Exemplo n.º 16
0
 public TelesaleScriptProvider(Contact contact, Telesale telesale, LeadPersonal leadPerson)
 {
     Contact = contact;
     Telesale = telesale;
     LeadPerson = leadPerson;
 }
Exemplo n.º 17
0
 public override ScriptActionResult Update(Site site, Contact contact, LeadPersonal person, Telesale telesale)
 {
     contact.DaToCheck = true;
     contact.DaToCheckInfo = InfoForDa;
     return ScriptActionResult.Completed;
 }
Exemplo n.º 18
0
        private Contact NextContact(LeadPersonal person)
        {
            IList<int> occupiedList;
            if (OverOccupyLimit(person, out occupiedList))
                return null;

            var codes = Enum.GetNames(typeof(CallingCode));
            return occupiedList.Count > 0
                ? UnitOfWork.ContactRepository.NextCleaningContact(codes, person.Id, occupiedList)
                : UnitOfWork.ContactRepository.NextCleaningContact(codes, person.Id);
        }