Пример #1
0
        public ActionResult UiDateTimeTest(UiDateTimeTestModel model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            return(View("UiDateTimeTestResults", model));
        }
Пример #2
0
        public ActionResult UiDateTimeTest()
        {
            ViewBag.PageTitle = "C# MVC DateTime Conversion | UiDateTimeModel Test Form";
            UiDateTimeTestModel model = null;

            try {
                var timeZone = TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time").StandardName;
                model = new UiDateTimeTestModel {
                    UiDateTime = new UiDateTimeModel(timeZone)
                    {
                    }
                };
            }
            catch (Exception e)
            {
                throw new Exception("UiDateTimeTestModel Error: " + e.Message);
            }

            return(View(model));
        }