예제 #1
0
 public bool them(Product pro)
 {
     try
     {
         db.Products.Add(pro);
         db.SaveChanges();
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #2
0
 public bool DangKi(Customer cus)
 {
     try
     {
         if (db.Customers.Where(a => a.CustomerID == cus.CustomerID).ToList().Count > 0)
         {
             return(false);
         }
         else
         {
             db.Customers.Add(cus);
             db.SaveChanges();
             return(true);
         }
     }
     catch (Exception)
     {
         return(false);
     }
 }
예제 #3
0
 public void AddOrder(Order or, List <Order_Detail> lst)
 {
     db.Orders.Add(or);
     db.Order_Details.AddRange(lst);
     db.SaveChanges();
 }