Esempio n. 1
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            CurrentTerm currentTerm = await db.CurrentTerms.FindAsync(id);

            db.CurrentTerms.Remove(currentTerm);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
        public async Task <ActionResult> Edit([Bind(Include = "Id,Name")] CurrentTerm currentTerm)
        {
            if (ModelState.IsValid)
            {
                db.Entry(currentTerm).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(currentTerm));
        }
Esempio n. 3
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Name")] CurrentTerm currentTerm)
        {
            if (ModelState.IsValid)
            {
                db.CurrentTerms.Add(currentTerm);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(currentTerm));
        }
Esempio n. 4
0
        // GET: StudentArea/CurrentTerms/Delete/5
        public async Task <ActionResult> Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            CurrentTerm currentTerm = await db.CurrentTerms.FindAsync(id);

            if (currentTerm == null)
            {
                return(HttpNotFound());
            }
            return(View(currentTerm));
        }
Esempio n. 5
0
 public string GetCurrentTerm()
 {
     return(CurrentTermId.HasValue ? CurrentTerm.GetTerm() : "-");
 }