コード例 #1
0
 public ActionResult Create(Actor actor)
 {
     if (!ModelState.IsValid)
     {
         return(View(actor));
     }
     db.AddActor(actor);
     TempData["notification-message"] = "Actor inserted successfully!";
     TempData["notification-color"]   = "success";
     Session["Actions"] = (int)Session["Actions"] + 1;
     return(RedirectToAction("Index"));
 }
コード例 #2
0
        public ActionResult Create(Actor actor)
        {
            if (!ModelState.IsValid)
            {
                return(View(actor));
            }

            db.AddActor(actor);                                                // edw h forma tou xrhsth epikoinwnei me to backend kai th database
            TempData["notification-message"] = "Actor inserted successfully!"; // metaferei message apo action se action, kai pws auto tha ginei render sto view
            TempData["notification-color"]   = "success";
            //to session xrhsimopoieitai gia kalathi proiontwn, login logout ktl ktl
            Session["Actions"] = (int)Session["Actions"] + 1; //metrhths meta apo kathe action, me casting se int. xwris to int tha eprepe na arxikopoiithei to session apo prin
            return(RedirectToAction("Index"));
        }
コード例 #3
0
 public JsonResult AddActor(Actor actor)
 {
     db.AddActor(actor);
     return(Json(actor));
 }