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

            return(isUpdated);
        }
示例#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));
        }
示例#3
0
文件: ItemGetway.cs 项目: ashiqqs/POS
        public bool IsItemUpdated(Item item)
        {
            dbContext.Entry(item).State = EntityState.Modified;
            var isUpdated = dbContext.SaveChanges() > 0;

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

            return(isUpdated);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#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);
        }