public bool them(Product pro) { try { db.Products.Add(pro); db.SaveChanges(); return(true); } catch (Exception) { return(false); } }
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); } }
public void AddOrder(Order or, List <Order_Detail> lst) { db.Orders.Add(or); db.Order_Details.AddRange(lst); db.SaveChanges(); }