Esempio n. 1
0
        public bool IsBranchUpdated(Branch branch)
        {
            dbContext.Entry(branch).State = EntityState.Modified;
            var isUpdated = dbContext.SaveChanges() > 0;

            return(isUpdated);
        }
Esempio n. 2
0
        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));
        }
Esempio n. 3
0
        public bool IsItemUpdated(Item item)
        {
            dbContext.Entry(item).State = EntityState.Modified;
            var isUpdated = dbContext.SaveChanges() > 0;

            return(isUpdated);
        }
Esempio n. 4
0
        public bool IsExpenseItemUpdated(ExpenseItem expenseItem)
        {
            dbContext.Entry(expenseItem).State = EntityState.Modified;
            var isUpdated = dbContext.SaveChanges() > 0;

            return(isUpdated);
        }
Esempio n. 5
0
        public bool Update(ExpenseCategory category)
        {
            PosDbContext db = new PosDbContext();

            db.ExpenseCategories.Attach(category);
            db.Entry(category).State = EntityState.Modified;
            return(db.SaveChanges() > 0);
        }
Esempio n. 6
0
        public bool IsPartyUpdated(Party party)
        {
            PosDbContext db = new PosDbContext();

            db.Parties.Attach(party);
            db.Entry(party).State = EntityState.Modified;
            return(db.SaveChanges() > 0);
        }
Esempio n. 7
0
        public bool Update(Organization organization)
        {
            PosDbContext db = new PosDbContext();

            db.Organizations.Attach(organization);
            db.Entry(organization).State = EntityState.Modified;
            return(db.SaveChanges() > 0);
        }
Esempio n. 8
0
        public bool Update(Employee employee)
        {
            PosDbContext db = new PosDbContext();

            db.Employees.Attach(employee);
            db.Entry(employee).State = EntityState.Modified;
            return(db.SaveChanges() > 0);
        }
Esempio n. 9
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);
        }