public bool IsBranchUpdated(Branch branch) { dbContext.Entry(branch).State = EntityState.Modified; var isUpdated = dbContext.SaveChanges() > 0; return(isUpdated); }
public IHttpActionResult PutCustomers(int id, Customers customers) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (id != customers.Id) { return(BadRequest()); } db.Entry(customers).State = EntityState.Modified; try { db.SaveChanges(); } catch (DbUpdateConcurrencyException) { if (!CustomersExists(id)) { return(NotFound()); } else { throw; } } return(StatusCode(HttpStatusCode.NoContent)); }
public bool IsItemUpdated(Item item) { dbContext.Entry(item).State = EntityState.Modified; var isUpdated = dbContext.SaveChanges() > 0; return(isUpdated); }
public bool IsExpenseItemUpdated(ExpenseItem expenseItem) { dbContext.Entry(expenseItem).State = EntityState.Modified; var isUpdated = dbContext.SaveChanges() > 0; return(isUpdated); }
public bool Update(ExpenseCategory category) { PosDbContext db = new PosDbContext(); db.ExpenseCategories.Attach(category); db.Entry(category).State = EntityState.Modified; return(db.SaveChanges() > 0); }
public bool IsPartyUpdated(Party party) { PosDbContext db = new PosDbContext(); db.Parties.Attach(party); db.Entry(party).State = EntityState.Modified; return(db.SaveChanges() > 0); }
public bool Update(Organization organization) { PosDbContext db = new PosDbContext(); db.Organizations.Attach(organization); db.Entry(organization).State = EntityState.Modified; return(db.SaveChanges() > 0); }
public bool Update(Employee employee) { PosDbContext db = new PosDbContext(); db.Employees.Attach(employee); db.Entry(employee).State = EntityState.Modified; return(db.SaveChanges() > 0); }
public bool Update(ItemCategory category) { PosDbContext db = new PosDbContext(); db.ItemCategories.Attach(category); db.Entry(category).State = EntityState.Modified; bool isUpdate = db.SaveChanges() > 0; return(isUpdate); }