// POST: Security public ActionResult Csrf(ContactDTO model) { if (ModelState.IsValid) { if (model != null) { bool insertOk = ContactUIService.Insert(model); if (insertOk) { ViewBag.Message = 1; ModelState.Clear(); } else { ViewBag.Message = 2; ModelState.Clear(); } } } return(View()); }
public ActionResult Contact(ContactDTO model) { if (ModelState.IsValid) { if (model != null) { model.CreatedUserNameDto = "Misafir Kullanıcı"; model.ModifiedUserNameDto = "Misafir Kullanıcı"; model.CreatedDateDto = DateTime.Now; model.ModifiedDateDto = DateTime.Now; bool insertok = ContactUIService.Insert(model); if (insertok) { Mesaj msj = new Mesaj() { param1 = "200", param2 = "You have enter correct date !!!" }; ModelState.Clear(); //return View(new ContactDTO()); return(Json(msj, JsonRequestBehavior.AllowGet)); } } } else { Mesaj msj = new Mesaj() { param1 = "404", param2 = "Exception occured while converting user date" }; return(Json(msj, JsonRequestBehavior.DenyGet)); } return(View()); }