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

                return(RedirectToAction(nameof(Index)));
            }
            return(View(department));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,EquipType,Model,SubModel,SerialNum,ServiceTag,DateReceived,RequestingDept,RequestedBy,InvoiceNum,Warranty,DecommissionDate,DecommissionStatus,DestroyDate,DestroyStatus,Manufacturer,Vendor,ManufacturerId,VendorId")] Equipment equipment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(equipment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(equipment));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("Id,EquipmentId,RequestedBy,RmaNum,DateShipped,TrackingNum,Recipient,StreetAddress1,StreetAddress2,StreetAddress3,City,StateId,State,Zip,Country,ContactEmail,ContactPhone,ReplacementSerialNumber,Returned,DateReturned")] Repair repair)
        {
            if (ModelState.IsValid)
            {
                _context.Add(repair);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(repair));
        }
예제 #4
0
        public async Task <IActionResult> Create([Bind("Id,FirstName,Name,LastName,Email,ColleaugeId")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(employee));
        }
        public async Task <IActionResult> Create([Bind("Id,Name")] Manufacturer manufacturer)
        {
            if (ModelState.IsValid)
            {
                _context.Add(manufacturer);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(manufacturer));
        }
        public async Task <IActionResult> Create([Bind("Id,Name,Abbreviation")] State state)
        {
            if (ModelState.IsValid)
            {
                _context.Add(state);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(state));
        }
예제 #7
0
        public async Task <IActionResult> Create([Bind("Id,ColleagueId,EquipmentId,Location,Floor,RoomNumber,RequestingDepartment,AssignedBy,AssignedDate,UnassignedBy,UnassignedDate")] Assignment assignment)
        {
            if (ModelState.IsValid)
            {
                _context.Add(assignment);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(assignment));
        }