Пример #1
0
        public async Task <IActionResult> Create([Bind("id,name,lastName,email,userName,password,phone,job")] User user)
        {
            if (ModelState.IsValid)
            {
                _context.Add(user);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(user));
        }
Пример #2
0
        public async Task <IActionResult> Create([Bind("id,name,identityCard,webPage,address,phone,sectors")] Client client)
        {
            if (ModelState.IsValid)
            {
                _context.Add(client);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(client));
        }
Пример #3
0
        public async Task <IActionResult> Create([Bind("id,ClientId,name,lastName,email,phone,jobPositions")] Contact contact)
        {
            if (ModelState.IsValid)
            {
                _context.Add(contact);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientId"] = new SelectList(_context.Cliente, "id", "id", contact.ClientId);
            return(View(contact));
        }
Пример #4
0
        public async Task <IActionResult> Create([Bind("id,subject,problem,who,ClientId,state")] SupportTickets supportTickets)
        {
            if (ModelState.IsValid)
            {
                _context.Add(supportTickets);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientId"] = new SelectList(_context.Cliente, "id", "id", supportTickets.ClientId);
            return(View(supportTickets));
        }
Пример #5
0
        public async Task <IActionResult> Create([Bind("id,subject,date,UserId,AVirtual,ClientId")] Meetings meetings)
        {
            if (ModelState.IsValid)
            {
                _context.Add(meetings);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClientId"] = new SelectList(_context.Cliente, "id", "id", meetings.ClientId);
            ViewData["UserId"]   = new SelectList(_context.User, "id", "id", meetings.UserId);
            return(View(meetings));
        }