Exemple #1
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,LastName,Mail,Position,Phone,ClientsID")] 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)));
            }
            ViewData["ClientsID"] = new SelectList(_context.Client, "ID", "ID", contact.ClientsID);
            return(View(contact));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Title,Problem,State,UsersID,ClientsID")] Tickets tickets)
        {
            if (id != tickets.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tickets);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TicketsExists(tickets.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientsID"] = new SelectList(_context.Client, "ID", "Name", tickets.ClientsID);
            ViewData["UsersID"]   = new SelectList(_context.Users, "ID", "Name", tickets.UsersID);
            return(View(tickets));
        }
Exemple #3
0
        public async Task <IActionResult> Edit(int id, [Bind("ID,Title,ReleaseDate,Type,UsersID,ClientsID")] 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)));
            }
            ViewData["ClientsID"] = new SelectList(_context.Client, "ID", "Name", meeting.ClientsID);
            ViewData["UsersID"]   = new SelectList(_context.Users, "ID", "Name", meeting.UsersID);
            return(View(meeting));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Name,LastName,Mail,Position,Phone")] 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));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ID,Card,Name,LastName,Password,PageWeb,Address,Phone,Type")] Users users)
        {
            if (id != users.ID)
            {
                return(NotFound());
            }

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