Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("BookId,BookTime,JourneyTime,JourneyPlace")] Cab cab)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cab);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(cab));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("EmployeeName,EmployeeNo,Email,Password,ProjectName,Gender,CabId")] Employee employee)
        {
            if (ModelState.IsValid)
            {
                _context.Add(employee);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CabId"] = new SelectList(_context.Cab, "CabId", "JourneyPlace", employee.CabId);
            return(View(employee));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("DropPointName,NewDropPointName,RouteId")] DropPoint dropPoint)
        {
            if (ModelState.IsValid)
            {
                _context.Add(dropPoint);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RouteId"] = new SelectList(_context.Route, "RouteId", "RouteName", dropPoint.RouteId);
            return(View(dropPoint));
        }
 public void InsertEmployee(Employee emp)
 {
     _dbContext.Add(emp);
     Save();
 }
 public void InsertRoute(Route route)
 {
     _dbContext.Add(route);
     Save();
 }
 public void InsertCab(Cab cab)
 {
     _dbContext.Add(cab);
     Save();
 }
Exemplo n.º 7
0
 public void InsertPoint(DropPoint dp)
 {
     _dbContext.Add(dp);
     Save();
 }