Exemplo n.º 1
0
        public ActionResult DxonnerLArbre(int id)
        {
            Retour.InitialiseRetour("Personne", "DxonnerLArbre", id, null);
            FormArbre fa = new FormArbre(new PersonneServiceAPI().Donner(id), null);

            return(View(fa));
        }
Exemplo n.º 2
0
        public ActionResult DonnerPourArbre(int id)
        {
            IEnumerable <PersonneIndex> per = new PersonneServiceAPI().DonnerPourArbre(id).Select(j => new PersonneIndex(j, true, true));

            per           = per.OrderBy(j => j.nom).ThenBy(j => j.prenom).ThenBy(j => j.dateDeNaissance).ThenBy(j => j.dateDeDeces);
            ViewBag.Arbre = id;
            Arbre a = new ArbreServiceAPI().Donner(id);

            ViewBag.ProprietaireArbre = a.Createur().login;
            ViewBag.NomArbre          = a.nom;
            Retour.InitialiseRetour("Personne", "DonnerPourArbre", id, null);
            return(View(per));
        }
Exemplo n.º 3
0
        public static DateTime ConvertionStringVersDateTime(string valeur)
        {
            if (valeur == null)
            {
                return(new DateTime());
            }

            string   heureString;
            string   dateString;
            DateTime Retour = new DateTime();

            if (valeur.Contains("T"))
            {
                dateString  = Regex.Split(valeur, "T")[0];
                heureString = Regex.Split(valeur, "T")[1];
                if (dateString.Contains("-"))
                {
                    string[] date = Regex.Split(dateString, "-");
                    if (date.Length == 3)
                    {
                        Retour = new DateTime(int.Parse(date[0]), int.Parse(date[1]), int.Parse(date[2]));
                    }
                }
                if (heureString.Contains(":"))
                {
                    string[] heure = Regex.Split(heureString, ":");
                    if (heure.Length == 2)
                    {
                        Retour = Retour.AddHours(double.Parse(heure[0])).AddMinutes(double.Parse(heure[1]));
                    }
                }
                return(Retour);
            }
            else
            {
                dateString = valeur;
            }
            if (dateString.Contains("-"))
            {
                string[] date = Regex.Split(dateString, "-");
                if (date.Length == 3)
                {
                    Retour = new DateTime(int.Parse(date[0]), int.Parse(date[1]), int.Parse(date[2]));
                }
            }
            return(Retour);
        }