public int DeleteOrder(Order C) { try { db.Entry(C).State = EntityState.Deleted; return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int DeleteProduct(Product P) { try { db.Entry(P).State = EntityState.Deleted; return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int UpdateAddress(Address A) { try { db.Entry(A).State = EntityState.Modified; return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public int UpdateCreditCardType(CreditCardType A) { try { db.Entry(A).State = EntityState.Modified; return(db.SaveChanges()); } catch (Exception e) { throw new Exception(e.Message); } }
public virtual int Update(T obj) { try { if (ValidateUpdate(obj)) { db.Entry(obj).State = System.Data.Entity.EntityState.Modified; return(db.SaveChanges()); } return(0); } catch (Exception e) { throw new Exception(e.Message); } }