public async Task <IActionResult> Create([Bind("Id,Name,HoursRequired,Status")] ContractTypes contractTypes) { if (ModelState.IsValid) { _context.Add(contractTypes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(contractTypes)); }
public async Task <IActionResult> Create([Bind("Id,Name")] TicketTypes ticketTypes) { if (ModelState.IsValid) { _context.Add(ticketTypes); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(ticketTypes)); }
public async Task <IActionResult> Create([Bind("Id,Name,Phone,Email")] Contacts contacts) { if (ModelState.IsValid) { _context.Add(contacts); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(contacts)); }
public async Task <IActionResult> Create([Bind("Id,TicketId,Date,UserId,Efforts")] Activities activities) { if (ModelState.IsValid) { _context.Add(activities); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["TicketId"] = new SelectList(_context.Tickets, "Id", "Name", activities.TicketId); return(View(activities)); }
public async Task <IActionResult> Create([Bind("Id,Name,Address,Phone,CountryId,Email,Status")] Accounts accounts) { if (ModelState.IsValid) { _context.Add(accounts); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CountryId"] = new SelectList(_context.Countries, "Id", "Name", accounts.CountryId); return(View(accounts)); }
public async Task <IActionResult> Create([Bind("Id,Name,AccountId,ContractTypeId,DateFrom,DateTo,Hours,Status")] Contracts contracts) { if (ModelState.IsValid) { _context.Add(contracts); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AccountId"] = new SelectList(_context.Accounts, "Id", "Name", contracts.AccountId); ViewData["ContractTypeId"] = new SelectList(_context.ContractTypes, "Id", "Name", contracts.ContractTypeId); return(View(contracts)); }
public async Task <IActionResult> Create([Bind("AccountId,ContactId")] AccountContacts accountContacts) { if (ModelState.IsValid) { _context.Add(accountContacts); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["AccountId"] = new SelectList(_context.Accounts, "Id", "Name", accountContacts.AccountId); ViewData["ContactId"] = new SelectList(_context.Contacts, "Id", "Name", accountContacts.ContactId); return(View(accountContacts)); }
public async Task <IActionResult> Create([Bind("Id,Name,ContractId,AssignedTo,Description,DateFrom,ContactId,TicketTypeId,EstimatedHours,CreatedBy,TicketImpactId,TicketUrgencyId,TicketPriority")] Tickets tickets) { if (ModelState.IsValid) { _context.Add(tickets); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ContactId"] = new SelectList(_context.Contacts, "Id", "Email", tickets.ContactId); ViewData["ContractId"] = new SelectList(_context.Contracts, "Id", "Name", tickets.ContractId); ViewData["TicketImpactId"] = new SelectList(_context.TicketImpacts, "Id", "Name", tickets.TicketImpactId); ViewData["TicketTypeId"] = new SelectList(_context.TicketTypes, "Id", "Name", tickets.TicketTypeId); ViewData["TicketUrgencyId"] = new SelectList(_context.TicketUrgencies, "Id", "Name", tickets.TicketUrgencyId); return(View(tickets)); }