public async Task <IActionResult> Create([Bind("Id,CompanyName,Contact,Phone,BillAddress,BillAddress2,BillCity,BillState,BillZip")] CompanyInfo companyInfo) { if (ModelState.IsValid) { _context.Add(companyInfo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(companyInfo)); }
public async Task <IActionResult> Create([Bind("Id,CompanyId,FirstName,LastName,Email,AccessFailedCount,LockoutEndDate,LockoutEnabled,PasswordHash,SecurityStamp,PhoneNumber")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CompanyId"] = new SelectList(_context.CompanyInfo, "Id", "CompanyName", user.CompanyId); return(View(user)); }
public async Task <IActionResult> Create([Bind("UserId,CompanyId,CampaignStartDate,CampaignDuration,TotalBudget,Tier1Objective,PreferredMediaApproach,TierId,Tier2ObjectiveId,IsBudgetFlexible,IsCampaignContinuous,IsCustomMarketSchedule,IsCustomMarketBudget,Remarks,Tier2ObjectiveGoal,Tier2ObjectiveBudgetFlexibility,CampaignDurationTypeId")] Submission submission) { if (ModelState.IsValid) { _context.Add(submission); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["CampaignDurationTypeId"] = new SelectList(_context.CampaignDurationType, "Id", "Type", submission.CampaignDurationTypeId); ViewData["CompanyId"] = submission.Company.CompanyName; ViewData["TierId"] = new SelectList(_context.Tier, "Id", "TierName", submission.TierId); ViewData["Tier2ObjectiveId"] = new SelectList(_context.Tier2Objective, "Id", "Objective", submission.Tier2ObjectiveId); return(View(submission)); }