public static void RefuseDemandeSuppression(int idDemande, int idValider) { DateTime fullDate = DateTime.Now; string date = (fullDate.Day < 10 ? "0" + fullDate.Day.ToString() : fullDate.Day.ToString()) + "/" + (fullDate.Month < 10 ? "0" + fullDate.Month.ToString() : fullDate.Month.ToString()) + "/" + fullDate.Year.ToString(); DemandeSuppression demandeSuppression = GetListDemandeSuppression().Find(x => x.Id == idDemande); demandeSuppression.Validate = 0; demandeSuppression.IdValider = idValider; demandeSuppression.DateValidation = date; }
public static void AddDemandeSuppression(int idUser, int idElement, String typeElement, String message) { DateTime fullDate = DateTime.Now; string date = (fullDate.Day < 10 ? "0" + fullDate.Day.ToString() : fullDate.Day.ToString()) + "/" + (fullDate.Month < 10 ? "0" + fullDate.Month.ToString() : fullDate.Month.ToString()) + "/" + fullDate.Year.ToString(); string nom = listUsers.Find(x => x.Id == idUser).Nom; string prenom = listUsers.Find(x => x.Id == idUser).Prenom; DemandeSuppression newDemandeSuppression = new DemandeSuppression(listDemandesSuppression[listDemandesSuppression.Count - 1].Id + 1, idUser, nom, prenom, idElement, typeElement, message, date, 0, 0, null); listDemandesSuppression.Add(newDemandeSuppression); }