public void Grabar(ArticuloXPack articuloxpack) { if (articuloxpack.Id == 0) { new ArticuloXPackDA().Save(articuloxpack); } else { new ArticuloXPackDA().Update(articuloxpack); } }
public void Delete(ArticuloXPack instance) { ISession hisession = null; try { hisession = NHibernateHelper.GetCurrentSession(); hisession.BeginTransaction(); hisession.Delete(instance); hisession.Transaction.Commit(); hisession.Close(); } catch (Exception ex) { if (hisession != null) { if (hisession.IsOpen) { hisession.Close(); } } } }
public void agregarArticulo(Articulo articulo) { if (!articuloRepetido(articulo)) { ArticuloXPack artxpack = new ArticuloXPack(); artxpack.CantidadPack = 1; artxpack.Articulo = articulo; listaArtxPack.Add(artxpack); object[] row = { articuloTemporal.CodigoArticulo, articuloTemporal.Titulo, articuloTemporal.Tipo, 1, articuloTemporal.PrecioVenta.ToString(), articuloTemporal.PrecioVenta.ToString() }; dgvArticulos.Rows.Add(row); calcularSubTotal(); } else { Utils.Utils.Error(null, "El articulo ya esta en la lista"); } }
public void Eliminar(ArticuloXPack artxPack) { new ArticuloXPackDA().Delete(artxPack); }