Ejemplo n.º 1
0
        public ActionResult EditPost(STUDENTS stEdit)
        {
            if (Session["matricn"] != null && Session["passw"] != null)
            {
                STUDENTCONTEXT sc = new STUDENTCONTEXT();
                if (ModelState.IsValid)
                {
                    sc.EditStudent(stEdit);


                    //STUDENTS usm = sc.AllStudent.Where(u => u.ST_Password == stEdit.password && u.MatricNumber.ToUpper() == matricNumber.ToUpper()).Single();

                    //Session["matricn"] = usm.MatricNumber.ToUpper();
                    //Session["passw"] = usm.ST_Password;
                    //Session["uID"] = usm.ID;
                    //Session["Userprofil"] = usm.FirstName.ToUpper() + " " + usm.LastName.ToUpper();



                    return(RedirectToAction("Editlist", "admin"));
                }

                STUDENTS s = sc.AllStudent.Single(als => als.ID == stEdit.ID);
                ViewBag.ima = s.ST_IMAGE.ToString();
                return(View(s));
            }
            return(RedirectToAction("Login", "admin"));
        }
Ejemplo n.º 2
0
        public ActionResult EditPost(STUDENTS stEdit)
        {
            if (Session["matricn"] != null && Session["passw"] != null)
            {
                STUDENTCONTEXT sc = new STUDENTCONTEXT();
                if (ModelState.IsValid)
                {
                    sc.EditStudent(stEdit);
                    return(RedirectToAction("Editlist", "admin"));
                }

                STUDENTS s = sc.AllStudent.Single(als => als.ID == stEdit.ID);
                ViewBag.ima = s.ST_IMAGE.ToString();
                return(View(s));
            }
            return(RedirectToAction("Login", "admin"));
        }