Example #1
0
        public void UpdateIsActive(int id, bool active)
        {
            var userlist = db.Users.Find(id);

            userlist.Active = active;
            db.Update(userlist);
            db.SaveChanges();
        }
Example #2
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Title,Quantity,Price,OrderID,AttachmentPath,Description,ID,NrIntern,UserID,CreateBy,UpdateBy,CreateDate,UpdateDate,OrganizationID,Remark,Deleted")] OrderPosition orderPosition)
        {
            if (id != orderPosition.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(orderPosition);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrderPositionExists(orderPosition.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OrderID"] = new SelectList(_context.Orders, "ID", "NrIntern", orderPosition.OrderID);
            return(View(orderPosition));
        }
Example #3
0
        public async Task <IActionResult> Edit(Guid id, [Bind("Title,Description,SendDate,Status,AmountNet,SupplierOrganizationID,OrderID,ID,NrIntern,UserID,CreateBy,UpdateBy,CreateDate,UpdateDate,OrganizationID,Remark,Deleted")] Invoice invoice)
        {
            if (id != invoice.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(invoice);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InvoiceExists(invoice.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["OrderID"] = new SelectList(_context.Orders, "ID", "NrIntern", invoice.OrderID);
            ViewData["SupplierOrganizationID"] = new SelectList(_context.Organizations, "ID", "ID", invoice.SupplierOrganizationID);
            return(View(invoice));
        }