Exemple #1
0
 public ActionResult Edit([Bind(Include = "Id,Name")] SubjectNames SubjectNames)
 {
     if (ModelState.IsValid)
     {
         db.Update(SubjectNames);
         return(RedirectToAction("Index"));
     }
     return(View(SubjectNames));
 }
Exemple #2
0
        public ActionResult Delete(int id = 0)
        {
            SubjectNames user = db.GetById(id);

            if (user == null)
            {
                return(HttpNotFound());
            }
            return(View(user));
        }
Exemple #3
0
        public ActionResult Create([Bind(Include = "Name")] SubjectNames SubjectNames)
        {
            if (ModelState.IsValid)
            {
                db.Add(SubjectNames);
                return(RedirectToAction("Index"));
            }

            return(View(SubjectNames));
        }
Exemple #4
0
        public ActionResult Details(int id = 0)
        {
            SubjectNames SubjectNames = db.GetById(id);

            if (SubjectNames == null)
            {
                return(HttpNotFound());
            }
            return(View(SubjectNames));
        }
Exemple #5
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     this.IsMouseVisible = true;
     // TODO: Add your initialization logic here
     subjects        = SubjectNames.CompSci;
     rects           = new Rectangle[16];
     names           = new string[16];
     enterKeyPressed = false;
     oldKb           = Keyboard.GetState();
     base.Initialize();
 }
 public Task <int> SaveSubjectNamesAsync(SubjectNames item)
 {
     if (item.SubjectId != 0)
     {
         return(database.UpdateAsync(item));
     }
     else
     {
         return(database.InsertAsync(item));
     }
 }
Exemple #7
0
        /// <summary>
        /// Allows the game to run logic such as updating the world,
        /// checking for collisions, gathering input, and playing audio.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Update(GameTime gameTime)
        {
            KeyboardState kb = Keyboard.GetState();

            // Allows the game to exit
            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed ||
                Keyboard.GetState().IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }

            // TODO: Add your update logic here
            if (kb.IsKeyDown(Keys.Space) &&
                !(oldKb.IsKeyDown(Keys.Space)))
            {
                switch (subjects)
                {
                case SubjectNames.CompSci:
                    subjects = SubjectNames.English;
                    break;

                case SubjectNames.English:
                    subjects = SubjectNames.Math;
                    break;

                case SubjectNames.Math:
                    subjects = SubjectNames.PE;
                    break;

                case SubjectNames.PE:
                    subjects = SubjectNames.CompSci;
                    break;
                }
            }
            oldKb = kb;
            base.Update(gameTime);
        }
 public void Update(SubjectNames entity)
 {
     rep.Update(entity);
 }
 public SubjectNames Add(SubjectNames entity)
 {
     return(rep.Add(entity));
 }