public ActionResult DeadlineOeuvreDeclaraion() { string currentdt = DateTime.Now.ToString("yyyy-MM-dd 00:00:00"); var listAlert = please.getAlll(); foreach (PI_OTDAV_Domain.Entities.oeuvredeclaration oda in listAlert) { if (oda.Deadline < DateTime.Now && oda.EtatDeadline == 0) { //Add Notif PI_OTDAV_Services.Services.UserServices us = new PI_OTDAV_Services.Services.UserServices(); PI_OTDAV_Web.Controllers.NotificationController nc = new PI_OTDAV_Web.Controllers.NotificationController(); user utilisateur = us.GetById((int)Session["id"]); Notification n = new Notification(); n.description = "votre oeuvre" + oda.Titre + " a été supprimer par ce que vous avez dépassé le deadline."; n.type = "Oeuvre_Declaration"; nc.Create(n, (int)Session["id"]); //End Add Notif oda.etat = "Supprimer"; oda.EtatDeadline = 1; please.Update(oda); please.Commit(); } } return(null); }
public ActionResult FirstAlertOeuvreDeclaraion() { // DateTime currentdt = DateTime.Now; string currentdt = DateTime.Now.ToString("yyyy-MM-dd 00:00:00"); // var currentdt = DateTime.Now.ToString("yyyy-MM-dd"); //var formatedDate = DateTime.Now.ToString("yyyy-MM-dd", System.Globalization.CultureInfo.InvariantCulture); var listAlert = please.getAlll(); foreach (PI_OTDAV_Domain.Entities.oeuvredeclaration oda in listAlert) { if (oda.DeadlineFirstAlerte < DateTime.Now && oda.EtatFirstAlerte == 0) { //oda.etat = "Supprimer"; //Add Notif PI_OTDAV_Services.Services.UserServices us = new PI_OTDAV_Services.Services.UserServices(); PI_OTDAV_Web.Controllers.NotificationController nc = new PI_OTDAV_Web.Controllers.NotificationController(); user utilisateur = us.GetById((int)Session["id"]); Notification n = new Notification(); n.description = "Veuillez Déposer votre oeuvre" + oda.Titre + " le plus tot possible."; n.type = "Oeuvre_Declaration"; nc.Create(n, (int)Session["id"]); //End Add Notif oda.EtatFirstAlerte = 1; please.Update(oda); please.Commit(); } } return(null); }