public async Task <IActionResult> Create([Bind("id,title,start,end,allDay")] EventViewModel eventViewModel)
        {
            if (ModelState.IsValid)
            {
                _context.Add(eventViewModel);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(eventViewModel));
        }
Beispiel #2
0
        public async Task <IActionResult> Create([Bind("Id,Wrokdates,Loginid,Workid,Hrs")] Hridworkhrs hridworkhrs)
        {
            if (ModelState.IsValid)
            {
                hridworkhrs.Id = Guid.NewGuid();
                _context.Add(hridworkhrs);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(hridworkhrs));
        }
        public async Task <IActionResult> Create([Bind("ID,DATES,NO,NAME,DEP,QUESTION1,QUESTION2,QUESTION3,QUESTION4,QUESTION5,QUESTION6,QUESTION7,QUESTION8,QUESTION9,QUESTION10,QUESTION11")] QUESTIONNAIRES qUESTIONNAIRES)
        {
            if (ModelState.IsValid)
            {
                //qUESTIONNAIRES.QUESTION1 = "ABCD";


                qUESTIONNAIRES.ID = Guid.NewGuid();
                _context.Add(qUESTIONNAIRES);
                await _context.SaveChangesAsync();

                //return RedirectToAction(nameof(Index));
                return(View("OK"));
            }

            //return View(qUESTIONNAIRES);
            return(View("OK"));
        }