Beispiel #1
0
        public async Task <IActionResult> Edit(string id, [Bind("Username,Email,Name,IsAdmin,HashedPassword,Salt")] UserModel user)
        {
            if (id != user._id.ToString())
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(user);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserExists(user.Email))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
            }
            return(Ok(user));
        }
Beispiel #2
0
        public async Task <IActionResult> Edit(string id, BorrowerModel borrower)
        {
            if (id != borrower.ID.ToString())
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(borrower);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return(NotFound());
                }
            }
            return(Ok(borrower));
        }
        public async Task <IActionResult> Edit(string id, TrusteeModel trustee)
        {
            if (id != trustee.ID.ToString())
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(trustee);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return(NotFound());
                }
            }
            return(Ok(trustee));
        }
        public async Task <IActionResult> Edit(string id, PropertyModel property)
        {
            if (id != property.ID.ToString())
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(property);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return(NotFound());
                }
            }
            return(Ok(property));
        }
        public async Task <IActionResult> Edit(string id, BrokerServicingModel brokerservicing)
        {
            if (id != brokerservicing.ID.ToString())
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(brokerservicing);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return(NotFound());
                }
            }
            return(Ok(brokerservicing));
        }
Beispiel #6
0
        public async Task <IActionResult> Edit(string id, AssignmentModel assignment)
        {
            if (id != assignment.ID.ToString())
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(assignment);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    return(NotFound());
                }
            }
            return(Ok(assignment));
        }