Пример #1
0
 public static void alterar(tb_Animal oNovoanimal)
 {
     using (SmartFarmEntities oDb = Helper.DataBaseHelper.getDataContext())
     {
         oDb.Entry(oNovoanimal).State = System.Data.Entity.EntityState.Modified;
         oDb.SaveChanges();
     }
 }
Пример #2
0
 public static void incluir(tb_Animal oNovoAnimal)
 {
     using (SmartFarmEntities oDb = Helper.DataBaseHelper.getDataContext())
     {
         oDb.tb_Animal.Add(oNovoAnimal);
         oDb.SaveChanges();
     }
 }
Пример #3
0
 public static void Excluir(tb_Animal oNovoanimal)
 {
     using (SmartFarmEntities oDb = Helper.DataBaseHelper.getDataContext())
     {
         oDb.tb_Animal.Attach(oNovoanimal); // Anexa o cliente que eu quero com base nos atributos
         oDb.tb_Animal.Remove(oNovoanimal);
         oDb.SaveChanges();
     }
 }