コード例 #1
0
        public ActionResult DeleteConfirmed(long id)
        {
            Acd_Student_Supervision acd_Student_Supervision = db.Acd_Student_Supervision.Find(id);
            var Department_Id = acd_Student_Supervision.Acd_Student.Department_Id;

            db.Acd_Student_Supervision.Remove(acd_Student_Supervision);
            db.SaveChanges();
            return(RedirectToAction("Create", new {
                Employee_Id = acd_Student_Supervision.Employee_Id,
                Department_Id = Department_Id
            }));
        }
コード例 #2
0
        // GET: StudentSupervision/Delete/5
        public ActionResult Delete(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Acd_Student_Supervision acd_Student_Supervision = db.Acd_Student_Supervision.Find(id);

            if (acd_Student_Supervision == null)
            {
                return(HttpNotFound());
            }
            return(View(acd_Student_Supervision));
        }
コード例 #3
0
        public ActionResult CreateStudentByDeparmentAndDosen(IEnumerable <long> checkStudent_IdToAdd, short?Department_Id, [Bind(Include = "Student_Supervision_Id,Student_Id,Employee_Id,Created_By,Created_Date,Modified_By,Modified_Date")] Acd_Student_Supervision acd_Student_Supervision)
        {
            if (ModelState.IsValid)
            {
                if (checkStudent_IdToAdd != null)
                {
                    foreach (var i in checkStudent_IdToAdd)
                    {
                        acd_Student_Supervision.Student_Id = i;

                        acd_Student_Supervision.Created_Date = DateTime.Now;

                        db.Acd_Student_Supervision.Add(acd_Student_Supervision);
                        db.SaveChanges();
                    }
                }
            }

            return(RedirectToAction("Create", new { Department_Id = Department_Id, Employee_Id = acd_Student_Supervision.Employee_Id }));
        }