Beispiel #1
0
        public ActionResult Pull(PullPacksViewModel pullPacksViewModel)
        {
            foreach (var pull in pullPacksViewModel.Packs.Where(d => d.Selected))
            {
                this.packStoreService.UpdatePullStatus(pull.ClientReference, true);
            }

            return(this.Json(new { error = false, Error = String.Empty }));
        }
Beispiel #2
0
        public ActionResult SendEmail(PullPacksViewModel pullPacksViewModel)
        {
            var packs = new StringBuilder();

            foreach (var pack in pullPacksViewModel.Packs)
            {
                packs.Append(String.Format("<li>{0} {1}</li>", pack.ClientReference, pack.Name));
            }

            String packInfo  = String.Format("<ul>{0}</ul>", packs);
            String emailBody = String.Format(
                "<p>The following packs have been pulled for job {0}: </p> <p>{1}</p>", pullPacksViewModel.JobId, packInfo);
            String from       = this.configurationManager.AppSetting("from");
            String to         = this.configurationManager.AppSetting("to");
            String subject    = this.configurationManager.AppSetting("subject");
            String mailServer = this.configurationManager.AppSetting("mailServer");

            this.emailService.SendEmail(from, to, subject, emailBody, mailServer);

            var redirectUrl = Url.Action("Authorised", "ManagePulls");

            return(this.Json(new { Url = redirectUrl, Error = string.Empty }));
        }