@{ acartuchos.fSeguridad("codigo"); string sid = Request.QueryString["id"].ToString(); string scant = Request.QueryString["ca"].ToString(); string dom = Request.QueryString["d"].ToString(); string pre = Request.QueryString["pr"].ToString(); string desc = Request.QueryString["desc"].ToString(); string cliente = Request.QueryString["cliente"].ToString(); string dom_existe = "", hos_existe = "", dom_id = ""; if (Session["choping_orden"] != null) { List Carrito = Session["choping_orden"] as List; int n = -1; int lCant = 0; if (n == -1) { string sDNS = "cweb"; var db = WebMatrix.Data.Database.Open(sDNS); var sql = "SELECT id, clave, nombre, precio FROM catart WHERE id = '" + sid + "'"; db.QuerySingle(sql); try { foreach (var row in db.Query(sql)) { string Precio = pre.ToString(); Carrito.Add(new Choping.cCarrito() { id = sid, clave = row.clave, nombre = row.nombre + " ", descripcion = desc, precio = Precio, cantidad = scant, }); if (row.clave == "PBASICO" || row.clave == "PVISION" || row.clave == "PSOLIDO" || row.clave == "PCOMERCIO") { hos_existe = "si"; } } } catch (Exception ex) { Response.Write("INFO:" + ex); } db.Connection.Close(); db.Close(); db.Dispose(); } else { int isCant = Convert.ToInt32(scant); int tCant = (lCant + isCant); scant = tCant.ToString(); Carrito.Where(d => d.id == sid).First().cantidad = scant; } Session["choping_orden"] = Carrito; } else { List Carrito = new List(); Session["choping_orden"] = ""; } string url = ("~/f/ordenes/ordenes_forma?c=" + cliente ); Response.Redirect(url); }