Exemplo n.º 1
0
        public ActionResult edit(studentmodel model)
        {
            studentdal dal = new studentdal();

            dal.update(model.studentid, model.studentpassword, model.studentmobile);
            return(View("view_update"));
        }
Exemplo n.º 2
0
        public ActionResult newstudent()
        {
            studentdal dal = new studentdal();

            ViewBag.cities = dal.Getcities();
            return(View());
        }
Exemplo n.º 3
0
        public ActionResult edit(int id)
        {
            studentdal   dal   = new studentdal();
            studentmodel model = dal.Find(id);

            return(View(model));
        }
Exemplo n.º 4
0
        public ActionResult delete(int id)
        {
            studentdal dal    = new studentdal();
            bool       status = dal.delete(id);

            return(View());
        }
Exemplo n.º 5
0
        public ActionResult Search(string key)
        {
            studentdal dal = new studentdal();
            List <studentprojection> list = dal.Search(key);

            return(View(list));
        }
Exemplo n.º 6
0
        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"));
        }
Exemplo n.º 7
0
        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());
            }
        }
Exemplo n.º 8
0
 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());
     }
 }