Пример #1
0
        private CallCriteriaResourceVO BuildContactDataForInitialAdvise(int id)
        {
            CallCriteriaResourceVO returnItem = new CallCriteriaResourceVO();

            CS_Contact contact = _contactRepository.Get(e => e.Active && e.ID == id && e.CS_Customer_Contact.Any(f => f.Active && f.CS_Customer.Active));
            IList<CS_CallCriteriaValue> criterias = _callCriteriaValueRepository.ListAll(e => e.Active && e.CS_CallCriteria.ContactID == id);

            if (contact != null)
            {
                returnItem.ResourceID = id;
                returnItem.Type = (int)Globals.CallCriteria.EmailVOType.Contact;
                returnItem.Name = contact.FullName;
                returnItem.Customer = contact.CS_Customer_Contact.FirstOrDefault().CS_Customer.Name;
                returnItem.ContactInfo = contact.ContactInfo;
                returnItem.AdviseInPerson = false;
                returnItem.AdviseByVoicemail = false;
            }

            if (criterias.Count > 0)
            {
                StringBuilder initialAdviseInfo = new StringBuilder();
                for (int i = 0; i < criterias.Count; i++)
                {
                    initialAdviseInfo.AppendLine(criterias[i].CS_CallCriteriaType.Description);
                }

                returnItem.InitialAdviseInformation = initialAdviseInfo.ToString();
            }

            return returnItem;
        }
Пример #2
0
        private CallCriteriaResourceVO BuildEmployeeDataForInitialAdvise(int employeeId)
        {
            CallCriteriaResourceVO returnItem = new CallCriteriaResourceVO();

            CS_Employee employee = _employeeRepository.Get(e => e.Active && e.ID == employeeId);
            IList<CS_CallCriteriaValue> criterias = _callCriteriaValueRepository.ListAll(e => e.Active && e.CS_CallCriteria.EmployeeID == employeeId);

            if (employee != null)
            {
                returnItem.ResourceID = employeeId;
                returnItem.Type = (int)Globals.CallCriteria.EmailVOType.Employee;
                returnItem.Name = employee.FullName;
                returnItem.Division = employee.FullDivisionName;
                returnItem.ContactInfo = employee.ContactInfo;
                returnItem.AdviseInPerson = false;
                returnItem.AdviseByVoicemail = false;
            }

            if (criterias.Count > 0)
            {
                StringBuilder initialAdviseInfo = new StringBuilder();

                initialAdviseInfo.Append(criterias[0].Value);
                for (int i = 1; i < criterias.Count; i++)
                {
                    initialAdviseInfo.Append(string.Format(", {0}", criterias[i].Value));
                }

                returnItem.InitialAdviseInformation = initialAdviseInfo.ToString();
            }

            return returnItem;
        }