示例#1
0
 public void Grabar(ArticuloXPack articuloxpack)
 {
     if (articuloxpack.Id == 0)
     {
         new ArticuloXPackDA().Save(articuloxpack);
     }
     else
     {
         new ArticuloXPackDA().Update(articuloxpack);
     }
 }
示例#2
0
        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();

                    }
                }

            }
        }
示例#3
0
        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");
            }
        }
示例#4
0
 public void Eliminar(ArticuloXPack artxPack)
 {
     new ArticuloXPackDA().Delete(artxPack);
 }