public IActionResult Upsert(EmployeeSpecial employee) { if (ModelState.IsValid) { if (employee.Id == Guid.Empty) { _unitOfWork.EmployeeSpecial.Add(employee); } else { _unitOfWork.EmployeeSpecial.Update(employee); } _unitOfWork.Save(); return(RedirectToAction(nameof(Index))); } return(View(employee)); }
public IActionResult Upsert(Guid id) { var employee = new EmployeeSpecial(); if (id == Guid.Empty) { //this is for create employee.BirthDate = DateTime.Now.AddYears(-18); return(View(employee)); } // this is for edit employee = _unitOfWork.EmployeeSpecial.Get(id); if (employee == null) { return(NotFound()); } return(View(employee)); }
private void onSpecialsChanged(EmployeeSpecial special) { addSpecial(special); }
private void addSpecial(EmployeeSpecial special) { var go = Instantiate(SpecialPrefab, specialContainer.transform, false); go.GetComponentInChildren <Text>().text = special.GetDisplayName(); }