Ejemplo n.º 1
0
        private void CreateEmailQueue(Form formData, FormType type)
        {
            List <Employees> listEmployees = _employeesService.GetList();

            try
            {
                List <EmailQueue> emails = new List <EmailQueue>();
                foreach (var employees in listEmployees)
                {
                    EmailQueue newEmail = GetEmail(type, formData.Data, employees.Email, employees.Name);

                    int addToQueue = _emailQueueService.AddNewEmail(newEmail);
                    if (addToQueue > 0)
                    {
                        emails.Add(newEmail);
                    }
                }

                TaskSentMail(emails);
            }
            catch (Exception ex)
            {
                Logger.ErrorException(ex);
            }
        }
Ejemplo n.º 2
0
        // GET: Admin/Employees
        public ActionResult Index()
        {
            var employeeList = _employeesServices.GetList();
            List <EmployeesModel> listData = employeeList.Select(d => new EmployeesModel()
            {
                Name        = d.Name,
                Email       = d.Email,
                PhoneNumber = d.PhoneNumber
            }).ToList();

            return(View(listData));
        }