public IActionResult AddEmergencyCall(AddEmergencyCallViewModel model) { if (ModelState.IsValid) { EmployeeEmergencyCall newEmergency = new EmployeeEmergencyCall { EmployeeId = model.EmployeeId, Name = model.Name, SurName = model.SurName, RelationTo = model.RelationTo, Phone = model.Phone }; _employeeRepository.AddEmployeeEmergencyCall(newEmergency); var successMessage = "EmergencyCall Info Created Successfully. Name: " + newEmergency.EmployeeId; TempData["successAlert"] = successMessage; // return RedirectToAction(successMessage, ""); return(PartialView("_PartialMessage")); } return(View()); }
public EmployeeEmergencyCall AddEmployeeEmergencyCall(EmployeeEmergencyCall emergency_Call) { _context.EmployeeEmergencyCalls.Add(emergency_Call); _context.SaveChanges(); return(emergency_Call); }