Beispiel #1
0
 void IStockRepository.LoadStock(List <StockDetail> stock)
 {
     using (YEXDBContext context = new YEXDBContext())
     {
         foreach (var eachStock in stock)
         {
             context.stocks.Add(eachStock);
         }
         context.SaveChanges();
     }
 }
Beispiel #2
0
 void IStockRepository.SaveOrder(OrderDetail orderDetail)
 {
     try
     {
         using (YEXDBContext context = new YEXDBContext())
         {
             context.orderHistory.Add(orderDetail);
             context.SaveChanges();
         }
     }
     catch (Exception ex)
     {
         // handle log
     }
 }