//Fin Comprar // cotizacion public ActionResult Cotizar(string id, string total) { CotizacionDAL cotizacion = new CotizacionDAL(); if (ComparaDigitos(id, total)) { return(RedirectToAction("Index", "Home")); } int precio_t = 0; if (Session["cart"] != null) { if (id == null) { return(RedirectToAction("Login", "Usuario")); } List <Item> cart = (List <Item>)Session["cart"]; foreach (var item in cart) { string precio = item.P.Precio_producto.ToString(); precio_t = precio_t + (item.p.Precio_producto.Value * item.Quantity); } if (precio_t != Int32.Parse(total)) { return(RedirectToAction("Index", "Home")); } else { ViewBag.Total = total; int ID = Int32.Parse(id); ViewBag.usuario = DALusuario.getUsuarioALLDATA(ID); int id_cotizacion = cotizacion.Ingresar(ID, cart, total); if (id_cotizacion != 0) { return(RedirectToAction("ReporteCotizacion", "Home", new { id_user = ID, id_venta = id_cotizacion })); } else { return(RedirectToAction("Index", "Home")); } } } else { return(View("Cart")); } }