//[HttpPost] public ActionResult askColaboration(ArticleModel model) { EmailModel eModel = new EmailModel(); ProfileDBHandle pdh = new ProfileDBHandle(); List <string> emails = new List <string>(); ArticleDBHandle adh = new ArticleDBHandle(); EmailController eController = new EmailController(); emails = pdh.getCoreMemberEmails(); string aAuthor = pdh.getArticleAuthor(model.articleId); foreach (string email in emails) { eModel.subject = "We ask your collaboration to review an article: "; eModel.message = "The article " + model.name + " published on " + model.publishDate + " by " + aAuthor + " was added to your available articles tray to review"; eModel.mail = email; eController.SendMail(eModel); pdh.addNomination(email, model.articleId); } adh.updateArticleState(model); return(RedirectToAction("Colaboration")); }
public ActionResult Profile() { ProfileDBHandle sdb = new ProfileDBHandle(); //ArticleDBHandle sdb1 = new ArticleDBHandle(); string user; if (!(Session["user"] is null)) //If someone has already sign in { user = Session["user"].ToString(); }
public string nomeneeEmails(int articleId) { ProfileDBHandle pdh = new ProfileDBHandle(); List <IsNominatedModel> nomenees = pdh.fetchNomenees(articleId); List <string> nomenees_emails = new List <string>(); foreach (IsNominatedModel nomenee in nomenees) { nomenees_emails.Add(nomenee.email); } return(JsonConvert.SerializeObject(nomenees_emails)); }
public ActionResult Registration(ProfileModel pmodel) { try { if (ModelState.IsValid) { ProfileDBHandle sdb = new ProfileDBHandle(); sdb.AddProfile(pmodel); ViewBag.Message = "We successfully created your profile!"; return(RedirectToAction("HomePage", "Article", null)); } } catch { ViewBag.Message = "Please, provide your information"; } return(View()); }