public ActionResult Details(string id) { var dal = new DAL.StudentDAL(); var Stud = dal.Search(id); return(View(Stud)); }
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)); }
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)); }
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)); }
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")); }