Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Student_Type student_Type = db.Student_Type.Find(id);

            db.Student_Type.Remove(student_Type);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "Id,Name")] Student_Type student_Type)
 {
     if (ModelState.IsValid)
     {
         db.Entry(student_Type).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(student_Type));
 }
Esempio n. 3
0
        public ActionResult Create([Bind(Include = "Id,Name")] Student_Type student_Type)
        {
            if (ModelState.IsValid)
            {
                db.Student_Type.Add(student_Type);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(student_Type));
        }
Esempio n. 4
0
        //overloaded constructor
        public Student(string name, string ppsn, string address, string phone, string email, string studentNumber,Student_Type type)
            : base(name, ppsn, address, phone, email)
        {

            this.StudentNumber = studentNumber;
            this.Pps = ppsn;
            this.Name = name;
            this.Address = Address;
            this.Phone = phone;
            this.Email = email;
            this.Type = type;

        }
Esempio n. 5
0
        // GET: Student_Type/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Student_Type student_Type = db.Student_Type.Find(id);

            if (student_Type == null)
            {
                return(HttpNotFound());
            }
            return(View(student_Type));
        }