예제 #1
0
        public async Task <IActionResult> Create([Bind("ID,UserID,Username,FullName,Email,PhoneNumber,SMSNumber,AccountStatus,ReceivesSMSAlertsNewDrivers,ReceivesSMSAlertsDriversTerminated,ReceivesSMSAlertsLongDriverWaits,SMSAlertDriverWaitTime")] Analyst analyst)
        {
            if (ModelState.IsValid)
            {
                _context.Add(analyst);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(analyst));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("AnalysisID,AnalystID,DriverID")] Analysis analysis)
        {
            if (ModelState.IsValid)
            {
                _context.Add(analysis);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AnalystID"] = new SelectList(_context.Analysts, "ID", "ID", analysis.AnalystID);
            ViewData["DriverID"]  = new SelectList(_context.Drivers, "DriverID", "DriverID", analysis.DriverID);
            return(View(analysis));
        }
예제 #3
0
 public async Task AddAsync(Driver driver)
 {
     _context.Add(driver);
     await _context.SaveChangesAsync();
 }
예제 #4
0
 public async Task AddAsync(Leg leg)
 {
     _context.Add(leg);
     await _context.SaveChangesAsync();
 }