public async Task <IActionResult> Create([Bind("ID,Name,LastName,Mail,Position,Phone")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
        public async Task <IActionResult> Create([Bind("ID,Card,Name,LastName,Password,PageWeb,Address,Phone,Type")] Users users)
        {
            if (ModelState.IsValid)
            {
                _context.Add(users);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(users));
        }
        public async Task <IActionResult> Create([Bind("Id,Title,Problem,State,UsersID,ClientsID")] Tickets tickets)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tickets);
                await _context.SaveChangesAsync();

                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 #4
0
        public async Task <IActionResult> Create([Bind("ID,Title,ReleaseDate,Type,UsersID,ClientsID")] Meeting meeting)
        {
            if (ModelState.IsValid)
            {
                _context.Add(meeting);
                await _context.SaveChangesAsync();

                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));
        }
Exemple #5
0
        public async Task <IActionResult> Create([Bind("ID,Name,LastName,Mail,Position,Phone,ClientsID")] Contact contact)
        {
            if (Login.isActiv == false)
            {
                return(View("Views/Users/Index.cshtml"));
            }
            if (ModelState.IsValid)
            {
                _context.Add(contact);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientsID"] = new SelectList(_context.Client, "ID", "Name", contact.ClientsID);
            return(View(contact));
        }