public bool AñadirLineaCarrito(CLineaCarrito Linea) { return(true); }
public bool AñadirLineaCarrito(CLineaCarrito Linea, int idCarrito) { return(true); }
private void CargaLineas() { ClsCapaDatos objDatos = new ClsCapaDatos(); objDatos.ConexString = this.ConnectionString; m_Lineas = new List <CLineaCarrito>(); DataSet dsLineas = objDatos.GetCarritoActual(this.IdCarrito); double fDescuento = 0; double fImporteDescuento = 0; double fPrecioORI = 0; double fprecioAct = 0; double fDescuentoPromo = 0; if (dsLineas.Tables[0].Rows.Count > 0) { CLineaCarrito linea; foreach (DataRow dr in dsLineas.Tables[1].Rows) { linea = new CLineaCarrito(); linea.IdCarritoDetalle = int.Parse(dr["id_Carrito_Detalle"].ToString()); linea.IdCarrito = this.IdCarrito; linea.IdArticulo = int.Parse(dr["IdArticulo"].ToString()); linea.idCabeceroDetalle = int.Parse(dr["Id_cabecero_detalle"].ToString()); linea.Cantidad = int.Parse(dr["Cantidad"].ToString()); linea.PVPORI = float.Parse(dr["PVPORI"].ToString()); linea.PVPACT = float.Parse(dr["PVPACT"].ToString()); linea.DTOArticulo = float.Parse(dr["DTOArticulo"].ToString()); linea.IdPromocion = int.Parse(dr["IdPromocion"].ToString()); linea.IdPedido = int.Parse(dr["IdPedido"].ToString()); //linea.IdNombreTalla = int.Parse(dr["IdNombreTalla"].ToString()); //linea.Descripcion = dr["Descripcion"].ToString(); //linea.Color = dr["Color"].ToString(); //linea.ModeloProveedor = dr["ModeloProveedor"].ToString(); //linea.IdTemporada = int.Parse(dr["IdTemporada"].ToString()); //linea.IdProveedor = int.Parse(dr["IdProveedor"].ToString()); //linea.IdTienda = int.Parse(dr["IdTienda"].ToString()); //linea.DtoPromo = float.Parse(dr["DtoPromo"].ToString()); linea.Promocion = dr["Promocion"].ToString(); linea.TipoArticulo = dr["TIPOCORTE"].ToString(); fImporteDescuento = Convert.ToDouble(dr["DTOArticulo"]); fPrecioORI = Convert.ToDouble(dr["PVPORI"]); fprecioAct = Convert.ToDouble(dr["PVPACT"]); //fDescuentoPromo = Convert.ToDouble(dr[ "DtoPromo"]); fDescuento = 100 * (fPrecioORI - fprecioAct) / fPrecioORI; fDescuento = fDescuento / 100; if (fImporteDescuento > 0) { //CultureInfo info = CultureInfo.GetCultureInfo("es-MX"); fDescuento = fDescuento / 100; //((Label)e.Row.FindControl("lblPorDescuento")).Text = Convert.ToDouble(fDescuento).ToString("P2", info); } this.DatosCarrito.ImporteDescuento += (fImporteDescuento + fDescuentoPromo); this.DatosCarrito.SubTotal += fPrecioORI; this.DatosCarrito.ImportePagar = ((fPrecioORI - fImporteDescuento) - fDescuentoPromo); this.DatosCarrito.ImportePromociones += 0; m_Lineas.Add(linea); } } }