Ejemplo n.º 1
0
 public ActionResult Index(StudentViewModel st)
 {
     if (Session["action"].ToString() == "Save")
     {
         st.EmailId = Session["emailid"].ToString();
         if (ModelState.IsValid)
         {
             int i = stb.CreateStudent(st);
             if (i > 0)
             {
                 ViewBag.SaveText = "Update";
             }
         }
         return(Content("Student Created Successfully", "text/html"));
     }
     else
     {
         if (ModelState.IsValid)
         {
             st.EmailId = Session["emailid"].ToString();
             int i = stb.UpdateStudent(st);
         }
         return(Content("Student updated Successfully", "text/html"));
     }
 }