public ActionResult RefuseEvent(int id) { List <EventPicture> pics = sep.GetMany(x => x.eventid == id).ToList(); foreach (var item in pics) { // if (System.IO.File.Exists(Request.MapPath(@"../Content/eventpics/" + item.picName))) // { System.IO.File.Delete(Request.MapPath(@"/Content/eventpics/" + item.picName)); //} sep.Delete(item); sep.Commit(); } IServiceMS spsms = new ServiceMS(); IServiceUserEvent spue = new serviceUserEvent(); string mails = spue.GetMany(x => x.participation == true).SelectMany(x => x.User.mail.Split(',')).ToString(); if (mails != null) { spsms.sendMail(mails, "l'évenement " + spe.GetById(id).EventTitle + "a été supprimer", "l'annonce de cet evenement a été suprrimer verifier avec les organizateurs de cet evenement"); } spe.refuseEvent(id); return(RedirectToAction("EventNotApproved")); }
public ActionResult AcceptAnnonce(int id) { Admin _admin = spa.Get(x => x.mailAdmin == User.Identity.Name); spe.acceptEvent(id, _admin.idAdmin); Logs log = new Logs(); log.adminid = _admin.idAdmin; log.eventid = id; log.date = DateTime.Now; spl.Add(log); spl.Commit(); IServiceMS spsms = new ServiceMS(); IServiceUserEvent spue = new serviceUserEvent(); string mails = spue.GetMany(x => x.participation == true).SelectMany(x => x.User.mail.Split(',')).ToString(); if (mails != null) { spsms.sendMail(mails, "l'évenement " + spe.GetById(id).EventTitle + "a été modifier consulter le lien ci dessous pour voir les changements", "localhost:8080/Event/Details/" + id); } return(RedirectToAction("EventNotApproved")); }