예제 #1
0
        public ActionResult Details(string id)
        {
            var dal  = new DAL.StudentDAL();
            var Stud = dal.Search(id);

            return(View(Stud));
        }
예제 #2
0
 public ActionResult EditStud(Entity.ProfileStudent model, string id)
 {
     try
     {
         var dal  = new DAL.StudentDAL();
         var stud = dal.Search(id);
         stud.Stud_id   = model.Stud_id;
         stud.Pre_Name  = model.Pre_Name;
         stud.FristName = model.FristName;
         stud.LastName  = model.LastName;
         stud.Group_id  = model.Group_id;
         stud.Branch    = model.Branch;
         stud.Faculty   = model.Faculty;
         var result = dal.EditeStud(stud);
         if (result)
         {
             Response.Write("<script> alert('แก้ไข้ข้อมูลสำเร็จ')</script>");
         }
         return(RedirectToAction("StudentList"));
     }
     catch (Exception)
     {
         Response.Write("<scrip> aler('ไม่สำเร็จ')</scrip>");
     }
     return(View(model));
 }
예제 #3
0
        public ActionResult StudHistory()
        {
            var    model = (Entity.ProfileStudent)Session["Stud"];
            string id    = model.Stud_id;
            var    dal   = new DAL.StudentDAL();
            var    stud  = dal.Search(id);

            return(View(stud));
        }
예제 #4
0
        public ActionResult Edit(string id)
        {
            using (var db = new Entity.Entities())
            {
                ViewBag.PreName = db.PreName.ToList();
            }
            var dal  = new DAL.StudentDAL();
            var stud = dal.Search(id);

            return(View(stud));
        }
예제 #5
0
        public ActionResult Delete(string id)
        {
            var dal    = new DAL.StudentDAL();
            var stud   = dal.Search(id);
            var result = dal.Delete(stud);

            if (result)
            {
                Response.Write("<script> alert('ลบข้อมูลเรียบร้อย')</script>");
            }
            return(RedirectToAction("StudentList"));
        }