예제 #1
0
        public static bool Modificar(Articulos Art)
        {
            bool paso = false;

            try
            {
                ContextoArt dbase = new ContextoArt();

                dbase.Entry(Art).State = EntityState.Modified;
                dbase.SaveChanges();
                paso = true;
            }
            catch (Exception)
            {
                throw;
            }

            return(paso);
        }
예제 #2
0
        public static bool Eliminar(int Id)
        {
            bool paso = false;

            try
            {
                ContextoArt dbase = new ContextoArt();
                Articulos   Art   = dbase.Art.Find(Id);

                dbase.Art.Remove(Art);
                dbase.SaveChanges();
                paso = true;
            }
            catch (Exception)
            {
                throw;
            }

            return(paso);
        }
예제 #3
0
        public static bool Guardar(Articulos Ar)
        {
            bool paso = false;

            try
            {
                ContextoArt dbase = new ContextoArt();

                dbase.Art.Add(Ar);
                dbase.SaveChanges();
                Arti = Ar;
                paso = true;
            }
            catch (Exception)
            {
                throw;
            }

            return(paso);
        }