Exemple #1
0
        public void Actualizar(VENTA P)
        {
            try
            {
                new DatVenta().Actualizar(P);
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
Exemple #2
0
        public int Insertar(VENTA P)
        {
            try
            {
                return new DatVenta().Insertar(P);
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
Exemple #3
0
        public int Insertar(VENTA P)
        {
            try
            {
                ContextoDB ct = new ContextoDB();
                ct.VENTA.Add(P);
                ct.SaveChanges();
                return P.CVenta;
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }
Exemple #4
0
        public void Actualizar(VENTA P)
        {
            try
            {
                ContextoDB ct = new ContextoDB();
                VENTA VENTA = ct.VENTA.Where(x => x.CVenta == P.CVenta).SingleOrDefault();

                if (VENTA != null)
                {
                    ct.Entry(VENTA).CurrentValues.SetValues(P);
                    ct.SaveChanges();
                }
            }
            catch (Exception ex)
            {

                throw ex;
            }

        }