Exemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("Associatesid,Experiance,Age,Name,PostId")] Associates associates)
        {
            if (ModelState.IsValid)
            {
                _context.Add(associates);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["PostId"] = new SelectList(_context.Post, "Postid", "Postid", associates.PostId);
            return(View(associates));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("Callsid,DateAndTime,PhoneNumber,DstinationNumber,CarId")] Calls calls)
        {
            if (ModelState.IsValid)
            {
                _context.Add(calls);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["CarId"] = new SelectList(_context.Cars, "Carsid", "Carsid", calls.CarId);
            return(View(calls));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Create([Bind("Carsid,RegistrationNumber,MarkId,BodyNumber,Data,EngineNumber,Year,Mileage,DateOfLastMaintetance,Machanic,SpecialMarks,DriverId")] Cars cars)
        {
            if (ModelState.IsValid)
            {
                _context.Add(cars);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["DriverId"] = new SelectList(_context.Associates, "Associatesid", "Associatesid", cars.DriverId);
            ViewData["MarkId"]   = new SelectList(_context.CarsMark, "CarsMarkid", "CarsMarkid", cars.MarkId);
            return(View(cars));
        }