public async Task <IActionResult> Edit(int id, [Bind("Id,BillStatusName")] BillStatus billStatus)
        {
            if (id != billStatus.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(billStatus);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BillStatusExists(billStatus.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(billStatus));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,CompanyRoleName")] CompanyRole companyRole)
        {
            if (id != companyRole.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(companyRole);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CompanyRoleExists(companyRole.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(companyRole));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,SiteNumber,SiteName,StreetAddress,ZipCode,City,Country,NumberOfFloors,SiteNotes,SiteRoleId,SiteStatusId,SiteTypeId,PersonId,PersonId1,CompanyId")] Site site)
        {
            if (id != site.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(site);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SiteExists(site.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(ListSites)));
            }
            ViewData["CompanyId"]    = new SelectList(_context.Company, "Id", "CompanyName", site.CompanyId);
            ViewData["PersonId"]     = new SelectList(_context.Person, "Id", "FullName", site.PersonId);
            ViewData["PersonId1"]    = new SelectList(_context.Person, "Id", "FullName", site.PersonId1);
            ViewData["SiteRoleId"]   = new SelectList(_context.Set <SiteRole>(), "Id", "SiteRoleName", site.SiteRoleId);
            ViewData["SiteStatusId"] = new SelectList(_context.Set <SiteStatus>(), "Id", "SiteStatusName", site.SiteStatusId);
            ViewData["SiteTypeId"]   = new SelectList(_context.Set <SiteType>(), "Id", "SiteTypeName", site.SiteTypeId);
            return(View(site));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,AssetBrandName")] AssetBrand assetBrand)
        {
            if (id != assetBrand.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(assetBrand);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AssetBrandExists(assetBrand.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(assetBrand));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,Description,Item1,Item2,Item3,Item4,Item5,Item6,Item7,Item8,Item9,Item10")] MtrlList mtrlList)
        {
            if (id != mtrlList.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(mtrlList);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MtrlListExists(mtrlList.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(ListMtrlLists)));
            }
            return(View(mtrlList));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,PersonRoleId,PersonStatusId,PersonTypeId,CompanyId,FirstName,LastName,StreetAddress,ZipCode,City,Country,Ssn,PhoneNumber1,PhoneNumber2,Email,PersonAccountsId")] Person person)
        {
            if (id != person.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(person);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonExists(person.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(ListPeople)));
            }
            ViewData["CompanyId"]        = new SelectList(_context.Company, "Id", "CompanyName", person.CompanyId);
            ViewData["PersonAccountsId"] = new SelectList(_context.Set <PersonAccounts>(), "Id", "PaymentDetails", person.PersonAccountsId);
            ViewData["PersonRoleId"]     = new SelectList(_context.Set <PersonRole>(), "Id", "PersonRoleName", person.PersonRoleId);
            ViewData["PersonStatusId"]   = new SelectList(_context.Set <PersonStatus>(), "Id", "PersonStatusName", person.PersonStatusId);
            ViewData["PersonTypeId"]     = new SelectList(_context.Set <PersonType>(), "Id", "PersonTypeName", person.PersonTypeId);
            return(View(person));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,CompanyNumber,CompanyName,StreetAddress,ZipCode,City,Country,CompanyRoleId,CompanyStatusId,CompanyTypeId")] Company company)
        {
            if (id != company.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(company);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CompanyExists(company.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(ListCompanies)));
            }
            ViewData["CompanyRoleId"]   = new SelectList(_context.Set <CompanyRole>(), "Id", "CompanyRoleName", company.CompanyRoleId);
            ViewData["CompanyStatusId"] = new SelectList(_context.Set <CompanyStatus>(), "Id", "CompanyStatusName", company.CompanyStatusId);
            ViewData["CompanyTypeId"]   = new SelectList(_context.Set <CompanyType>(), "Id", "CompanyTypeName", company.CompanyTypeId);
            return(View(company));
        }
    public async Task <IActionResult> Edit(int id, [Bind("Id,ArenaNumber,ArenaName,StreetAddress,ZipCode,City,Country,DistrictId,ArenaStatusId")] Arena arena)
    {
        if (id != arena.Id)
        {
            return(NotFound());
        }

        if (ModelState.IsValid)
        {
            try
            {
                _context.Update(arena);
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!ArenaExists(arena.Id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }
            return(RedirectToAction(nameof(ListArenas)));
        }
        ViewData["ArenaStatusId"] = new SelectList(_context.Set <ArenaStatus>(), "Id", "StatusName", arena.ArenaStatusId);
        ViewData["DistrictId"]    = new SelectList(_context.Set <District>(), "Id", "DistrictName", arena.DistrictId);
        return(View(arena));
    }
        public async Task <IActionResult> Edit(int id, [Bind("Id,SiteId,AssetStatusId,AssetTypeId,AssetBrandId,Name,MACAddress,Model,SerialNumber,Connectivity,LocalIP,Ethernet1LLDP,Ethernet1")] Asset asset)
        {
            if (id != asset.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(asset);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AssetExists(asset.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(ListAssets)));
            }
            ViewData["AssetBrandId"]  = new SelectList(_context.Set <AssetBrand>(), "Id", "AssetBrandName", asset.AssetBrandId);
            ViewData["AssetStatusId"] = new SelectList(_context.Set <AssetStatus>(), "Id", "AssetStatusName", asset.AssetStatusId);
            ViewData["AssetTypeId"]   = new SelectList(_context.Set <AssetType>(), "Id", "AssetTypeName", asset.AssetTypeId);
            ViewData["SiteId"]        = new SelectList(_context.Site, "Id", "NoSite", asset.SiteId);
            return(View(asset));
        }
Exemple #10
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,IncidentPriorityId,IncidentStatusId,IncidentTypeId,IncidentNumber,Created,PersonId,SiteId,Received,PersonId1,FEScheduled,PersonId2,Description,FEEntersSite,FEEExitsSite,Logg,IssueResolved,Resolution,PurchaseOrderId,MtrlListId")] Incident incident)
        {
            if (id != incident.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(incident);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!IncidentExists(incident.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(ListIncidents)));
            }
            ViewData["MtrlListId"]         = new SelectList(_context.Set <MtrlList>(), "Id", "Description", incident.MtrlListId);
            ViewData["PersonId"]           = new SelectList(_context.Set <Person>(), "Id", "FullName", incident.PersonId);
            ViewData["PersonId2"]          = new SelectList(_context.Set <Person>(), "Id", "FullName", incident.PersonId2);
            ViewData["IncidentPriorityId"] = new SelectList(_context.Set <IncidentPriority>(), "Id", "IncidentPriorityName", incident.IncidentPriorityId);
            ViewData["IncidentStatusId"]   = new SelectList(_context.Set <IncidentStatus>(), "Id", "IncidentStatusName", incident.IncidentStatusId);
            ViewData["IncidentTypeId"]     = new SelectList(_context.Set <IncidentType>(), "Id", "IncidentTypeName", incident.IncidentTypeId);
            ViewData["PurchaseOrderId"]    = new SelectList(_context.Set <PurchaseOrder>(), "Id", "PONumber", incident.PurchaseOrderId);
            ViewData["PersonId1"]          = new SelectList(_context.Set <Person>(), "Id", "FullName", incident.PersonId1);
            ViewData["SiteId"]             = new SelectList(_context.Set <Site>(), "Id", "NoSite", incident.SiteId);
            return(View(incident));
        }
        public async Task <IActionResult> Edit(int id, [Bind("Id,CompanyId,CompanyId1,BillingDate,DueDate,NABLogId,NABLogId1,NABLogId2,NABLogId3,NABLogId4,BillingTerms,Hours,PriceHour,MtrCost,TotalCost,BillStatusId")] Bill bill)
        {
            if (id != bill.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(bill);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BillExists(bill.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(ListBillsCreated)));
            }
            ViewData["BillStatusId"] = new SelectList(_context.BillStatus, "Id", "BillStatusName", bill.BillStatusId);
            ViewData["CompanyId1"]   = new SelectList(_context.Company, "Id", "CompanyName", bill.CompanyId1);
            ViewData["CompanyId"]    = new SelectList(_context.Company, "Id", "CompanyName", bill.CompanyId);
            ViewData["NABLogId"]     = new SelectList(_context.NABLog, "Id", "LogNotes", bill.NABLogId);
            ViewData["NABLogId1"]    = new SelectList(_context.NABLog, "Id", "LogNotes", bill.NABLogId1);
            ViewData["NABLogId2"]    = new SelectList(_context.NABLog, "Id", "LogNotes", bill.NABLogId2);
            ViewData["NABLogId3"]    = new SelectList(_context.NABLog, "Id", "LogNotes", bill.NABLogId3);
            ViewData["NABLogId4"]    = new SelectList(_context.NABLog, "Id", "LogNotes", bill.NABLogId4);
            return(View(bill));
        }