Exemplo n.º 1
0
        public ActionResult Index()
        {
            EmailSendVM model = new EmailSendVM();
            CandidatesService canService = new CandidatesService();
            model.Recievers = canService.GetAll();
            TryUpdateModel(model);

            if (!String.IsNullOrEmpty(model.Search))
            {
                switch (model.SearchType)
                {
                    case SearchEnum.UsedTechnology:
                        EmailService.Recievers = model.Recievers.Where(c => c.UsedTechnologies
                                                            .Any(t => t.Name.ToLower().Contains(model.Search.ToLower()))).ToList();
                        break;
                    case SearchEnum.ProgrammingLanguage:
                        EmailService.Recievers = model.Recievers.Where(c => c.ProgrammingLanguages
                                                            .Any(p => p.Name.ToLower().Contains(model.Search.ToLower()))).ToList();
                        break;
                    case SearchEnum.Name:
                    default:
                        EmailService.Recievers = model.Recievers.Where(c => c.FirstName.ToLower().Contains(model.Search.ToLower()) || c.LastName.ToLower().Contains(model.Search.ToLower())).ToList();
                        break;
                }
            }
            return View(model);
        }
Exemplo n.º 2
0
        public ActionResult Fill()
        {
            EmailSendVM model = new EmailSendVM();
            TryUpdateModel(model);
            EmailService.Subject = model.Subject;
            EmailService.Body = model.Body;
            EmailService.Pass = model.Password;

            return RedirectToAction("SendMail", "Email");
        }
Exemplo n.º 3
0
        public ActionResult Set()
        {
            EmailSendVM model = new EmailSendVM();
            return View(model);

        }