Example #1
0
        public static bool Alter(Vendedor V)
        {
            LojaEntities db = SingletonObjectContext.Instance.Context;

            try
            {
                db.Entry(V).State = EntityState.Modified;
                db.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Example #2
0
        public static bool Delete(Vendedor V)
        {
            LojaEntities db = SingletonObjectContext.Instance.Context;

            try
            {
                db.Vendedores.Remove(V);
                db.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Example #3
0
        public static bool Delete(Produto P)
        {
            LojaEntities db = SingletonObjectContext.Instance.Context;

            try
            {
                db.Produtos.Remove(P);
                db.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Example #4
0
        public static bool Insert(VendaEItem VI)
        {
            LojaEntities db = SingletonObjectContext.Instance.Context;

            try
            {
                db.VendaEItens.Add(VI);
                db.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Example #5
0
        public static bool Insert(Administrador A)
        {
            LojaEntities db = SingletonObjectContext.Instance.Context;

            try
            {
                db.Administradores.Add(A);
                db.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Example #6
0
        public static bool Delete(ItemVenda I)
        {
            LojaEntities db = SingletonObjectContext.Instance.Context;

            try
            {
                db.Itens.Remove(I);
                db.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }
Example #7
0
        public static bool Insert(Cliente C)
        {
            LojaEntities db = SingletonObjectContext.Instance.Context;

            try
            {
                db.Clientes.Add(C);
                db.SaveChanges();
                return(true);
            }
            catch
            {
                return(false);
            }
        }