public ActionResult Create(CatSociosModels DatosSocio) { _CatSocio_Datos DBSocio = new _CatSocio_Datos(); try { if (Token.IsTokenValid()) { if (ModelState.IsValid) { DatosSocio.Conexion = Conexion; DatosSocio.Opcion = 1; DatosSocio.Usuario = User.Identity.Name; DatosSocio = DBSocio.ABCatSocios(DatosSocio); if (DatosSocio.Completado == true) { TempData["typemessage"] = "1"; TempData["message"] = "Los datos se guardaron correctamente."; Token.ResetToken(); return(RedirectToAction("Index")); } else { TempData["typemessage"] = "2"; TempData["message"] = "Ocurrio un error al intentar guardar los datos. Intente más tarde."; return(View(DatosSocio)); } } else { return(View(DatosSocio)); } } else { return(RedirectToAction("Index")); } } catch { TempData["typemessage"] = "2"; TempData["message"] = "Ocurrio un error al intentar guardar los datos. Contacte a soporte técnico."; return(View(DatosSocio)); } }