Example #1
0
        // GET: Home
        public ActionResult Index()
        {
            FloraAndFaunaEntities db = new FloraAndFaunaEntities();
            PLANTA planta            = db.PLANTAs.SingleOrDefault(x => x.idplanta == 1);

            PlantaViewModel plantaVM = new PlantaViewModel();

            plantaVM.idplanta      = planta.idplanta;
            plantaVM.nombrePlanta  = planta.nombrePlanta;
            plantaVM.especie       = planta.especie;
            plantaVM.flor          = planta.flor;
            plantaVM.familia       = planta.familia;
            plantaVM.nombrechileno = planta.nombrechileno;
            plantaVM.nombreingles  = planta.nombreingles;
            plantaVM.description   = planta.description;

            return(View(plantaVM));
        }
Example #2
0
    public static DateTime obtenerHoraDeLaCuenta(DateTime hwTime, PLANTA utc)
    {
        //DateTime hwTime = new DateTime();
        try
        {
            TimeZoneInfo hwZone = TimeZoneInfo.FindSystemTimeZoneById(GetEnumDescription(utc));

            /*return String.Format ("{0} {1} is {2} local time.",
             *      hwTime,
             *      hwZone.IsDaylightSavingTime(hwTime) ? hwZone.DaylightName : hwZone.StandardName,
             *      TimeZoneInfo.ConvertTime(hwTime, hwZone, TimeZoneInfo.Local));*/
            return(TimeZoneInfo.ConvertTime(hwTime, TimeZoneInfo.Local, TimeZoneInfo.Local));
        }
        catch (TimeZoneNotFoundException)
        {
            Console.WriteLine("The registry does not define the Hawaiian Standard Time zone.");
        }
        catch (InvalidTimeZoneException)
        {
            Console.WriteLine("Registry data on the Hawaiian STandard Time zone has been corrupted.");
        }
        return(DateTime.SpecifyKind(DateTime.Now, DateTimeKind.Local));
    }