public ActionResult edit(studentmodel model) { studentdal dal = new studentdal(); dal.update(model.studentid, model.studentpassword, model.studentmobile); return(View("view_update")); }
public ActionResult newstudent() { studentdal dal = new studentdal(); ViewBag.cities = dal.Getcities(); return(View()); }
public ActionResult edit(int id) { studentdal dal = new studentdal(); studentmodel model = dal.Find(id); return(View(model)); }
public ActionResult delete(int id) { studentdal dal = new studentdal(); bool status = dal.delete(id); return(View()); }
public ActionResult Search(string key) { studentdal dal = new studentdal(); List <studentprojection> list = dal.Search(key); return(View(list)); }
public ActionResult getprofiledetails() { int loginid = Convert.ToInt32(Session["loginid"]); studentdal dal = new studentdal(); studentmodel model = dal.Find(loginid); ViewBag.id = model.studentid; ViewBag.name = model.studentname; ViewBag.imageaddress = model.studentimageaddress; return(PartialView("myprofilepartialview")); }
public ActionResult newstudent(studentmodel model) { if (ModelState.IsValid) { model.studentimageaddress = "/images/" + Guid.NewGuid() + ".jpg"; model.studentimagefile.SaveAs(Server.MapPath(model.studentimageaddress)); studentdal dal = new studentdal(); int id = dal.Addstudent(model); ViewBag.msg = "student added: " + id; ModelState.Clear(); ViewBag.cities = dal.Getcities(); return(View()); } else { studentdal dal = new studentdal(); ViewBag.cities = dal.Getcities(); return(View()); } }
public ActionResult login(loginviewmodel model) { if (ModelState.IsValid) { studentdal dal = new studentdal(); bool status = dal.login(model); if (status == true) { Session["loginid"] = model.loginid; return(RedirectToAction("index", "student")); } else { ViewBag.msg = "invalid user id or password"; ModelState.Clear(); return(View()); } } else { return(View()); } }