Ejemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            YearDegree yearDegree = db.YearDegrees.Find(id);

            db.YearDegrees.Remove(yearDegree);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "YearDegreeID,Year,DegreeID,Units")] YearDegree yearDegree)
 {
     if (ModelState.IsValid)
     {
         db.Entry(yearDegree).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DegreeID = new SelectList(db.Degrees, "DegreeID", "DegreeName", yearDegree.DegreeID);
     return(View(yearDegree));
 }
Ejemplo n.º 3
0
        public ActionResult Create([Bind(Include = "YearDegreeID,Year,DegreeID,Units")] YearDegree yearDegree)
        {
            if (ModelState.IsValid)
            {
                db.YearDegrees.Add(yearDegree);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.DegreeID = new SelectList(db.Degrees, "DegreeID", "DegreeName", yearDegree.DegreeID);
            return(View(yearDegree));
        }
Ejemplo n.º 4
0
        // GET: YearDegrees/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            YearDegree yearDegree = db.YearDegrees.Find(id);

            if (yearDegree == null)
            {
                return(HttpNotFound());
            }
            return(View(yearDegree));
        }
Ejemplo n.º 5
0
        // GET: YearDegrees/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            YearDegree yearDegree = db.YearDegrees.Find(id);

            if (yearDegree == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DegreeID = new SelectList(db.Degrees, "DegreeID", "DegreeName", yearDegree.DegreeID);
            return(View(yearDegree));
        }
Ejemplo n.º 6
0
        public int RegisterCourse(StudentCours val)
        {
            StudentCours added;

            try
            {
                YearDegree deg = new YearDegree();
                deg.LectureDegree = "0";
                deg.MidtermDegree = "0";
                deg.SectionDegree = "0";
                deg.Total         = "0";
                YearDegree yearAdded = context.YearDegrees.Add(deg);
                context.SaveChanges();
                val.YearDegreeID = yearAdded.ID;
                val.FinalDegree  = "0";
                added            = context.StudentCourses.Add(val);
                context.SaveChanges();
            }
            catch (Exception exe)
            {
                throw;
            }
            return(added.ID);
        }