Beispiel #1
0
        public IActionResult Create()
        {
            _controllerUtil.SetLiActive("Olay");
            ViewBag.LiActives = _controllerUtil.LiActives;
            var model = new OlayCreateViewModel
            {
                Olay      = new OlayModel(),
                Ihbarlar  = new MultiSelectList(_ihbarService.GetIhbarlar(), "Id", "Ozet"),
                Saatler   = new SelectList(_timeUtil.Hours),
                Dakikalar = new SelectList(_timeUtil.Minutes)
            };

            return(View(model));
        }
Beispiel #2
0
        public IActionResult Create(OlayModel olay)
        {
            if (ModelState.IsValid)
            {
                _olayService.AddOlay(olay);
                return(RedirectToAction("Index"));
            }
            _controllerUtil.SetLiActive("Olay");
            ViewBag.LiActives = _controllerUtil.LiActives;
            var model = new OlayCreateViewModel
            {
                Olay      = new OlayModel(),
                Ihbarlar  = new MultiSelectList(_ihbarService.GetIhbarlar(), "Id", "Ozet"),
                Saatler   = new SelectList(_timeUtil.Hours),
                Dakikalar = new SelectList(_timeUtil.Minutes)
            };

            return(View(model));
        }