public async Task <IActionResult> Create([Bind("Id,BillStatusName")] BillStatus billStatus)
        {
            if (ModelState.IsValid)
            {
                _context.Add(billStatus);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(billStatus));
        }
        public async Task <IActionResult> Create([Bind("Id,CompanyRoleName")] CompanyRole companyRole)
        {
            if (ModelState.IsValid)
            {
                _context.Add(companyRole);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(companyRole));
        }
        public async Task <IActionResult> Create([Bind("Id,Description,Item1,Item2,Item3,Item4,Item5,Item6,Item7,Item8,Item9,Item10")] MtrlList mtrlList)
        {
            if (ModelState.IsValid)
            {
                _context.Add(mtrlList);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(ListMtrlLists)));
            }
            return(View(mtrlList));
        }
        public async Task <IActionResult> Create([Bind("Id,AssetTypeName")] AssetType assetType)
        {
            if (ModelState.IsValid)
            {
                _context.Add(assetType);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(assetType));
        }
    public async Task <IActionResult> Create([Bind("Id,ArenaNumber,ArenaName,StreetAddress,ZipCode,City,Country,DistrictId,ArenaStatusId")] Arena arena)
    {
        if (ModelState.IsValid)
        {
            _context.Add(arena);
            await _context.SaveChangesAsync();

            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> Create([Bind("Id,CompanyNumber,CompanyName,StreetAddress,ZipCode,City,Country,CompanyRoleId,CompanyStatusId,CompanyTypeId")] Company company)
        {
            if (ModelState.IsValid)
            {
                _context.Add(company);
                await _context.SaveChangesAsync();

                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> Create([Bind("Id,SiteId,AssetStatusId,AssetTypeId,AssetBrandId,Name,MACAddress,Model,SerialNumber,Connectivity,LocalIP,Ethernet1LLDP,Ethernet1")] Asset asset)
        {
            if (ModelState.IsValid)
            {
                _context.Add(asset);
                await _context.SaveChangesAsync();

                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));
        }
        public async Task <IActionResult> Create([Bind("Id,PersonRoleId,PersonStatusId,PersonTypeId,CompanyId,FirstName,LastName,StreetAddress,ZipCode,City,Country,Ssn,PhoneNumber1,PhoneNumber2,Email,PersonAccountsId")] Person person)
        {
            if (ModelState.IsValid)
            {
                _context.Add(person);
                await _context.SaveChangesAsync();

                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> Create([Bind("Id,SiteNumber,SiteName,StreetAddress,ZipCode,City,Country,NumberOfFloors,SiteNotes,SiteRoleId,SiteStatusId,SiteTypeId,PersonId,PersonId1,CompanyId")] Site site)
        {
            if (ModelState.IsValid)
            {
                _context.Add(site);
                await _context.SaveChangesAsync();

                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> Create([Bind("Id,CompanyId,CompanyId1,BillingDate,DueDate,NABLogId,NABLogId1,NABLogId2,NABLogId3,NABLogId4,BillingTerms,Hours,PriceHour,MtrCost,TotalCost,BillStatusId")] Bill bill)
        {
            if (ModelState.IsValid)
            {
                _context.Add(bill);
                await _context.SaveChangesAsync();

                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));
        }
示例#11
0
        public async Task <IActionResult> Create([Bind("Id,IncidentPriorityId,IncidentStatusId,IncidentTypeId,IncidentNumber,Created,PersonId,SiteId,Received,PersonId1,FEScheduled,PersonId2,Description,FEEntersSite,FEEExitsSite,Logg,IssueResolved,Resolution,PurchaseOrderId.MtrlListId")] Incident incident)
        {
            if (ModelState.IsValid)
            {
                _context.Add(incident);
                await _context.SaveChangesAsync();

                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));
        }