Пример #1
0
        /// <summary>
        /// Voyage vers {pays} le {date} avec {ownerDisplayname}
        /// </summary>
        /// <param name="proj"></param>
        /// <returns></returns>
        public static string GetFriendDisplayName(this IProjet proj)
        {
            int    nbSubscribers = proj.UserAbonnes.Count();
            string friendsLabel  = (nbSubscribers > 0) ? (++nbSubscribers) + " personnes" : proj.OwnerUserProfile.DisplayName;

            return("Voyage vers " + proj.GetShortDisplayName() + " avec " + friendsLabel);
        }
Пример #2
0
        private string GetDefaultMessageSubject(int projId)
        {
            IProjet proj = Data.ProjetDataAccess.GetProjet(projId);

            if (proj != null)
            {
                return("Message à propos du voyage n°" + projId + ": " + proj.GetShortDisplayName());
            }
            return("(Sans sujet)");
        }
Пример #3
0
        public ActionResult Delete(int projetId)
        {
            try
            {
                IProjet proj = Data.ProjetDataAccess.GetProjet(projetId);
                if (CurrentUserId == proj.OwnerUserId)
                {
                    Data.ProjetDataAccess.Remove(proj);

                    TempData["ViewInfos"] = new string[] { "Le voyage " + proj.GetShortDisplayName() + " a bien été supprimé" };
                }
            }
            catch (Exception ex)
            {
                Dictionary <string, string> modelError = new Dictionary <string, string>();
                modelError.Add("_FORM", "Le voyage n°" + projetId + " n'a pas pu être supprimé");
                TempData["ModelError"] = modelError;
            }


            return(RedirectToAction("MonCompte", "User"));
        }