Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            subpracticallist subpracticallist = db.subpracticallists.Find(id);

            db.subpracticallists.Remove(subpracticallist);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "id,name,sem,year,batch")] subpracticallist subpracticallist)
 {
     if (ModelState.IsValid)
     {
         db.Entry(subpracticallist).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(subpracticallist));
 }
Пример #3
0
        public ActionResult Create([Bind(Include = "id,name,sem,year,batch")] subpracticallist subpracticallist)
        {
            if (ModelState.IsValid)
            {
                db.subpracticallists.Add(subpracticallist);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(subpracticallist));
        }
Пример #4
0
        // GET: subpracticallists/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            subpracticallist subpracticallist = db.subpracticallists.Find(id);

            if (subpracticallist == null)
            {
                return(HttpNotFound());
            }
            return(View(subpracticallist));
        }
 public ActionResult Delete(int id, FormCollection collection)
 {
     try
     {
         subpracticallist subjectlist = db.subpracticallists.Find(id);
         db.subpracticallists.Remove(subjectlist);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View());
     }
 }
        // GET: assignpracteacher/Edit/5
        public ActionResult Edit(int?id)
        {
            subpracticallist assgn = new subpracticallist();

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            assgn = db.subpracticallists.Find(id);
            if (assgn == null)
            {
                return(HttpNotFound());
            }
            assgn.selectadvisor = getpracteachers();
            return(View(assgn));
        }
Пример #7
0
        // GET: subpracticallists/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            subpracticallist subpracticallist = new subpracticallist();

            subpracticallist = db.subpracticallists.Find(id);
            subpracticallist.selectpracsem  = getsem();
            subpracticallist.selectpracyear = getyear();
            if (subpracticallist == null)
            {
                return(HttpNotFound());
            }
            return(View(subpracticallist));
        }
        public ActionResult Edit(subpracticallist subteach)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    db.Entry(subteach).State = System.Data.Entity.EntityState.Modified;
                    tempvar            = Convert.ToInt32(subteach.teacherid);
                    TempData["techid"] = tempvar;
                    db.Entry(subteach).Property(x => x.batch).IsModified = false;
                    db.Entry(subteach).Property(x => x.sem).IsModified   = false;
                    db.Entry(subteach).Property(x => x.year).IsModified  = false;

                    db.SaveChanges();
                    return(RedirectToAction("Index", "assignpracteacher", TempData["techid"]));
                }
                return(View(subteach));
            }
            catch
            {
                return(View());
            }
        }