예제 #1
0
 public IActionResult Create(Subject model)
 {
     if (ModelState.IsValid)
     {
         _Subject.Add(model);
         return(RedirectToAction("Index"));
     }
     return(View(model));
 }
 public InvoerControl(ISubject model)
 {
     InitializeComponent();
     this.model         = model;
     lblEenheid.Content = model.Eenheid;
     groupBox.Header    = "druk in " + model.Naam;
     model.Add(Update);       //kan enkel hier bij Dependency Injection
     model.Druk = model.Druk; //activeert de Notify
 }
예제 #3
0
    public override void Enter()
    {
        UnityEngine.Debug.Log($"Enter {typeof(PlayerTurnState)}");

        playerTurnEnder.Add(this);

        foreach (var button in playerButtons)
        {
            button.SetInteractable(true);
        }
    }
        public IActionResult Post([FromBody] Subject Subject)
        {
            try
            {
                var result = _subject.Add(Subject);

                _unitOfWork.Commit();

                if (result.Errors.Any())
                {
                    return(BadRequest(result.Errors));
                }

                return(Ok(result));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex));
            }
        }
예제 #5
0
        public ActionResult Create(SubjectViewDTO subject)
        {
            Subject myNeySubject = new Subject
            {
                Description = subject.Description,
                Content     = subject.Content,
                Header      = subject.Header,
                MemberID    = HttpContext.Session.GetObjectFromJson <Member>("Member").ID,
                IsDeleted   = false
            };

            _subject.Add(myNeySubject);
            foreach (var item in SubjectID)
            {
                _subjectCategory.Add(new SubjectCategory {
                    CategoryID = item,
                    SubjectID  = myNeySubject.ID
                });
            }
            return(RedirectToAction("Index", "Member"));
        }
예제 #6
0
        public IActionResult Add(string subject, string id)
        {
            if (!string.IsNullOrEmpty(subject) && !string.IsNullOrEmpty(subject))
            {
                Subject model = new Subject
                {
                    Lessonid    = Convert.ToInt32(id),
                    SubjectName = subject
                };

                _subject.Add(model);
                _subject.Save();
                TempData["result"] = "Saved..";
            }
            else
            {
                TempData["result"] = "Please fill in text....";
            }



            return(RedirectToAction("List", "Lesson"));
        }
예제 #7
0
 private void OnEnable()
 {
     subject.Add(this);
 }
 public UitvoerControl(ISubject model)
 {
     InitializeComponent();
     model.Add(UpdateWijzer); //kan enkel hier bij dependency injection
     model.Druk = model.Druk; //activeert de notify
 }
 public override void Enter()
 {
     attackSubject.Add(this);
     defendSubject.Add(this);
     healSubject.Add(this);
 }