public ActionResult Buscar(CombustibleModel _model) { if (Session["StringToken"] == null) { return(View(AutenticacionServicio.InitIndex(new Models.Seguridad.LoginModel()))); } return(RedirectToAction("Index", new { desc = _model.DescripcionBusqueda })); }
// GET: Combustible public ActionResult Index(int?id, string desc = null, string msj = null) { if (Session["StringToken"] == null) { return(RedirectToAction("Index", "Home")); } _tkn = Session["StringToken"].ToString(); if (!string.IsNullOrEmpty(msj)) { ViewBag.Msj = msj; } CombustibleModel model = new CombustibleModel(); if (id != 0 && id != null) { model = CatalogoServicio.ListaCombustibleID(id.Value, _tkn); ViewBag.EsEdicion = true; } if (TempData["RespuestaDTO"] != null) { if (!((RespuestaDTO)TempData["RespuestaDTO"]).Exito) { ViewBag.MensajeError = Validar((RespuestaDTO)TempData["RespuestaDTO"]); } else { ViewBag.Tipo = "alert-success"; } } ViewBag.Combustibles = CatalogoServicio.ListaCombustibleIdEmp(TokenServicio.ObtenerIdEmpresa(_tkn), _tkn); if (desc != "" && desc != null) { model.DescripcionBusqueda = desc; ViewBag.Combustibles = CatalogoServicio.ListaCombustibleFiltrado(desc, _tkn); if (ViewBag.Combustibles.Count == 0) { ViewBag.Msj = "No se encontraron resultados"; } ViewBag.Tipo = "alert-danger"; } ViewBag.EsAdmin = TokenServicio.ObtenerEsAdministracionCentral(_tkn); return(View(model)); }
public ActionResult Guardar(CombustibleModel _Obj) { if (Session["StringToken"] == null) { return(RedirectToAction("Index", "Home", AutenticacionServicio.InitIndex(new Models.Seguridad.LoginModel()))); } _tkn = Session["StringToken"].ToString(); var respuesta = CatalogoServicio.CrearCombustible(_Obj, _tkn); TempData["RespuestaDTO"] = respuesta; if (respuesta.Exito) { return(RedirectToAction("Index", new { msj = respuesta.Mensaje })); } else { return(RedirectToAction("Index")); } }
// Start is called before the first frame update void Start() { _combustibleModel = Instantiate(_combustibleModel); referenceHeight = transform.position.y; }