Exemplo n.º 1
0
 public static bool AddProduct(Product p, DataModelContainer destModel)
 {
     try
     {
         destModel.ProductSet.Add(p);
         destModel.SaveChanges();
         return true;
     }
     catch(Exception ex)
     {
         return false;
     }
 }
Exemplo n.º 2
0
 public static bool AddOrder(Order o, DataModelContainer destModel)
 {
     try
     {
         destModel.OrderSet.Add(o);
         destModel.SaveChanges();
         return true;
     }
     catch (Exception ex)
     {
         return false;
     }
 }
Exemplo n.º 3
0
 public static bool AddOrders(List<Order> _orders, DataModelContainer destModel)
 {
     try
     {
         foreach (Order o in _orders)
         {
             destModel.OrderSet.Add(o);
         }
         destModel.SaveChanges();
         return true;
     }
     catch (Exception ex)
     {
         return false;
     }
 }
Exemplo n.º 4
0
 public static bool AddDeal(Deal d, DataModelContainer destModel)
 {
     try
     {
         destModel.DealSet.Add(d);
         destModel.SaveChanges();
         return true;
     }
     catch (Exception ex)
     {
         return false;
     }
 }