Esempio n. 1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,LastName,Adress,email,CelphoneNumber,Position")] Contact contact)
        {
            if (id != contact.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(contact);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ContactExists(contact.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(contact));
        }
Esempio n. 2
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Title,Date,IsVirtual")] Meeting meeting)
        {
            if (id != meeting.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(meeting);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MeetingExists(meeting.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(meeting));
        }
Esempio n. 3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,LegalDocument,WebSite,Adress,CelphoneNumber,Sector")] Client client)
        {
            if (id != client.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(client);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClientExists(client.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
Esempio n. 4
0
        public async Task <IActionResult> Edit(int id, [Bind("id,Name,Surname,DateOfBirth,Login")] User user)
        {
            if (id != user.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(user);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserExists(user.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Esempio n. 5
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Title,Detail,ReportedBy,State")] SupportTicket supportTicket)
        {
            if (id != supportTicket.ID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(supportTicket);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SupportTicketExists(supportTicket.ID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(supportTicket));
        }
Esempio n. 6
0
            public async Task<IActionResult> Edit (int id, [Bind ("ID,Name,LastName,email,password,role")] User user) {
                if (id != user.ID) {
                    return NotFound ();
                }

                if (ModelState.IsValid) {
                    try {
                        _context.Update (user);
                        await _context.SaveChangesAsync ();
                    } catch (DbUpdateConcurrencyException) {
                        if (!UserExists (user.ID)) {
                            return NotFound ();
                        } else {
                            throw;
                        }
                    }
                    return RedirectToAction (nameof (Index));
                }
                return View (user);
            }