public ActionResult Create(CompraViewModel com) { try { CompraCEN comCEN = new CompraCEN(); comCEN.CreaCompra(com.compradorId, com.LibroId, com.tipo_pago, com.infoTarjeta, com.fecha, com.terminal, com.comercio); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult index_user(CompraViewModel com) { try { string id = Request.QueryString["libro"]; int variablelibro = Int32.Parse(id); string id2 = Request.QueryString["user"]; int variableuser = Int32.Parse(id2); CompraCEN comCEN = new CompraCEN(); comCEN.CreaCompra(variableuser, variablelibro, com.tipo_pago, com.infoTarjeta, com.fecha, com.terminal, com.comercio); return(RedirectToAction("Index")); } catch { return(View()); } }