public ActionResult DeleteConfirmed(int id)
        {
            StudentAssigned studentAssigned = db.StudentAssigned.Find(id);

            db.StudentAssigned.Remove(studentAssigned);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,StudentInfo_FK,Department_FK,ResidentType_FK")] StudentAssigned studentAssigned)
 {
     if (ModelState.IsValid)
     {
         db.Entry(studentAssigned).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Department_FK   = new SelectList(db.Department, "Id", "Name", studentAssigned.Department_FK);
     ViewBag.ResidentType_FK = new SelectList(db.ResidentType, "Id", "ResidentType1", studentAssigned.ResidentType_FK);
     ViewBag.StudentInfo_FK  = new SelectList(db.StudentInfo, "Id", "StudentNameBangla", studentAssigned.StudentInfo_FK);
     return(View(studentAssigned));
 }
        // GET: StudentAssigneds/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentAssigned studentAssigned = db.StudentAssigned.Find(id);

            if (studentAssigned == null)
            {
                return(HttpNotFound());
            }
            return(View(studentAssigned));
        }
        // GET: StudentAssigneds/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            StudentAssigned studentAssigned = db.StudentAssigned.Find(id);

            if (studentAssigned == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Department_FK   = new SelectList(db.Department, "Id", "Name", studentAssigned.Department_FK);
            ViewBag.ResidentType_FK = new SelectList(db.ResidentType, "Id", "ResidentType1", studentAssigned.ResidentType_FK);
            ViewBag.StudentInfo_FK  = new SelectList(db.StudentInfo, "Id", "StudentNameBangla", studentAssigned.StudentInfo_FK);
            return(View(studentAssigned));
        }