public int CreateOrder(Order C) { try { this.db.Orders.Add(C); return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int CreateProduct(Product P) { try { db.Products.Add(P); return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int CreateCreditCardType(CreditCardType A) { try { db.CreditCardTypes.Add(A); return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int CreateOrderHistory(OrderHistory A) { try { db.OrderHistories.Add(A); return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int CreateProductType(ProductType U) { try { this.db.ProductTypes.Add(U); return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int CreateAddress(Address A) { try { db.Addresses.Add(A); return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int CreateUser(User U) { try { this.db.Users.Add(U); return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int CreateContact(Contact C) { try { this.db.Contacts.Add(C); return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int DeleteProductImage(int Id) { try { ProductImage pi = db.ProductImages.Where(p => p.ID == Id).FirstOrDefault(); db.ProductImages.Remove(pi); return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public virtual int Create(T obj) { try { if (ValidateCreate(obj)) { this.DbSet.Add(obj); return(db.SaveChanges()); } return(0); } catch (Exception e) { throw new Exception(e.Message); } }
public int CreateReview(Review R) { try { this.db.Reviews.Add(R); return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int UpdateStatus(int orderID, int statusID) { try { using (var context = new B2C_ECEntities()) { context.Orders.Find(orderID).OrderStatus_ID = statusID; return(context.SaveChanges()); } } catch (Exception e) { throw new Exception(e.Message); } }
public int UpdateStatus(int orderID, int statusID) { try { using (var context = new B2C_ECEntities()) { context.Orders.Find(orderID).OrderStatus_ID = statusID; return context.SaveChanges(); } } catch (Exception e) { throw new Exception(e.Message); } }