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")); }
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")); }
public JsonResult AddActor(Actor actor) { db.AddActor(actor); return(Json(actor)); }