Exemplo n.º 1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,UserId,CompanyId,CampaignStartDate,CampaignDuration,TotalBudget,Tier1Objective,PreferredMediaApproach,TierId,Tier2ObjectiveId,IsBudgetFlexible,IsCampaignContinuous,IsCustomMarketSchedule,IsCustomMarketBudget,Remarks,Tier2ObjectiveGoal,Tier2ObjectiveBudgetFlexibility,CampaignDurationTypeId,AuthorizationName,IsAuthorized")] Submission submission)
        {
            if (id != submission.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(submission);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SubmissionExists(submission.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                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);
            //ViewData["UserId"] = new SelectList(_context.User, "Id", "Email", submission.UserId);
            return(View(submission));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,CompanyId,FirstName,LastName,Email,AccessFailedCount,LockoutEndDate,LockoutEnabled,PasswordHash,SecurityStamp,PhoneNumber")] User user)
        {
            if (id != user.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(user);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UserExists(user.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CompanyId"] = new SelectList(_context.CompanyInfo, "Id", "CompanyName", user.CompanyId);
            return(View(user));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,CompanyName,Contact,Phone,BillAddress,BillAddress2,BillCity,BillState,BillZip")] CompanyInfo companyInfo)
        {
            if (id != companyInfo.Id)
            {
                return(NotFound());
            }

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