Example #1
0
 public void UpdateTypeProduct(TypeProduct typePro)
 {
     using (var context = new WebServiceDBContext())
     {
         context.Entry(typePro).State = System.Data.Entity.EntityState.Modified;
         context.SaveChanges();
     }
 }
Example #2
0
 public void AddTypeProduct(TypeProduct typePro)
 {
     using (var context = new WebServiceDBContext())
     {
         context.TypeProduct.Add(typePro);
         context.SaveChanges();
     }
 }
Example #3
0
 public void RemoveTypeProduct(long id)
 {
     using (var context = new WebServiceDBContext())
     {
         TypeProduct tproduct = context.TypeProduct.Find(id);
         context.Entry(tproduct).State = EntityState.Deleted;
         context.SaveChanges();
     }
 }
Example #4
0
        public TypeProduct GetTypeProduct(long id)
        {
            TypeProduct tproduct = null;

            using (var context = new WebServiceDBContext())
            {
                tproduct = context.TypeProduct.Find(id);
            }

            return(tproduct);
        }