public async Task <IActionResult> Create([Bind("StaffId,FirstName,LastName,EmailAddress,Street,MobilePhone")] Staff staff) { if (ModelState.IsValid) { dataContext.Add(staff); await dataContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(staff)); }
public async Task <IActionResult> Create([Bind("PostalDistrictId,City,Zipcode")] PostalDistrict postalDistrict) { if (ModelState.IsValid) { _context.Add(postalDistrict); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(postalDistrict)); }
public async Task <IActionResult> Create([Bind("VehicleId,VehicleModel,RegistrationDtl")] Vehicle vehicle) { if (ModelState.IsValid) { dataContext.Add(vehicle); await dataContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(vehicle)); }
public async Task <IActionResult> Create([Bind("CustomerId,FirstName,LastName,EmailAddress,Street,DateBirth,MobilePhone,PostalDistrictId")] Customer customer) { if (ModelState.IsValid) { dataContext.Add(customer); await dataContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PostalDistrictId"] = new SelectList(dataContext.PostalDistrict, "PostalDistrictId", "Zipcode"); return(View(customer)); }
public async Task <IActionResult> Create([Bind("EvaluationId,Resulte,Title,Description,BookingLogId")] Evaluation evaluation) { if (ModelState.IsValid) { dataContext.Add(evaluation); await dataContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["BookingLogId"] = new SelectList(dataContext.BookingLog, "BookingLogId", "CustomerId", evaluation.BookingLogId); return(View(evaluation)); }
public async Task <IActionResult> Create([Bind("ActivityTypeId,Price,Title,StartDate,EndDate,BookingLogId,VehicleId")] ActivityType activityType) { if (ModelState.IsValid) { dataContext.Add(activityType); await dataContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } // ViewData["BookingLogId"] = new SelectList(dataContext.BookingLog, "BookingLogId", "BookingLogId", activityType.BookingLogId); ViewData["VehicleId"] = new SelectList(dataContext.Vehicle, "VehicleId", "VehicleModel", activityType.VehicleId); return(View(activityType)); }
public async Task <IActionResult> Create([Bind("BookingLogId,CreatedBy,CreatedDate,LastModifiedDate,LastModifiedBy,StaffId,CustomerId,ActivityTypeId")] BookingLog bookingLog) { if (ModelState.IsValid) { dataContext.Add(bookingLog); await dataContext.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["ActivityTypeId"] = new SelectList(dataContext.ActivityType, "ActivityTypeId", "Title", bookingLog.ActivityTypeId); ViewData["CustomerId"] = new SelectList(dataContext.Customer, "CustomerId", "FirstName", bookingLog.CustomerId); ViewData["StaffId"] = new SelectList(dataContext.Staff, "StaffId", "FirstName", bookingLog.StaffId); return(View(bookingLog)); }