public async Task <IActionResult> Edit(int id, [Bind("SpecialistTypeId,SpecialistTypeName,OwnerSignature,EntryDate")] SpecialistType specialistType) { if (id != specialistType.SpecialistTypeId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(specialistType); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SpecialistTypeExists(specialistType.SpecialistTypeId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(specialistType)); }
// Prospective(candidate) employee public Employee(SpecialistType specialistType, QualificationLevel qualificationLevel, string personalId, string firstName, string lastName, string phoneNumber, string email, DateTime birthDate) : base(specialistType, personalId, firstName, lastName, phoneNumber, email, birthDate) { this.qualificationLevel = qualificationLevel; this.specialistType = specialistType; }
public Specialist(int id, string lastName, string name, int subId, SpecialistType specialistType, string roomNumber, PersonType personType = PersonType.Specialist) : base(id, lastName, name, personType) { SubId = subId; SpecialistType = specialistType; RoomNumber = roomNumber; }
public async Task <IActionResult> Create([Bind("SpecialistTypeId,SpecialistTypeName,OwnerSignature,EntryDate")] SpecialistType specialistType) { if (ModelState.IsValid) { _context.Add(specialistType); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(specialistType)); }
public Person(SpecialistType specialistType, string personalId, string firstName, string lastName, string phoneNumber, string email, DateTime birthDate) { this.specialistType = SpecialistType; this.personalId = personalId; this.firstName = firstName; this.lastName = lastName; this.birthDate = birthDate; this.email = email; this.phoneNumber = phoneNumber; }
//Constructors public Employee(string companyId, string teamId, string departmentId, SpecialistType specialistType, QualificationLevel qualificationLevel, uint salary, string personalId, string firstName, string lastName, string phoneNumber, string email, DateTime birthDate) : base(specialistType, personalId, firstName, lastName, phoneNumber, email, birthDate) { this.companyId = companyId; this.departmentId = departmentId; this.teamId = teamId; this.qualificationLevel = qualificationLevel; this.specialistType = specialistType; this.salary = salary; }
public void Hire(Team team, SpecialistType specialistType, QualificationLevel qualificationLevel, string personalId, string firstName, string lastName, string numberPhone, string email, DateTime birthDate) { if (hrAuthority) { Employee employee = new Employee(specialistType, qualificationLevel, personalId, firstName, lastName, numberPhone, email, birthDate); team.AddEmployee(employee); //Hire(team, employee); } else { Console.WriteLine("Contact the HR department for that question"); } }
public static Employee GenerateFutureEmployee() { var rand = new Random(); var qualificationLevelCount = Enum.GetNames(typeof(QualificationLevel)).Length; QualificationLevel qualificationLevel = (QualificationLevel)rand.Next(1, qualificationLevelCount + 1); var specialistTypeCount = Enum.GetNames(typeof(SpecialistType)).Length; SpecialistType specialistType = (SpecialistType)rand.Next(1, specialistTypeCount + 1); string firstName = TestUtil.GetRandomFirstName(6); string lastName = TestUtil.GetRandomLastName(4); string email = TestUtil.GetRandomEmail(10); string phoneNumber = TestUtil.GetRandomPhoneNumber(); DateTime birthDate = TestUtil.GetDateOfBirth(18, 70); string personalId = TestUtil.getGuid(); Employee employee = new Employee(specialistType, qualificationLevel, personalId, firstName, lastName, phoneNumber, email, birthDate); //Console.WriteLine(employee.ToString() + "\n"); return(employee); }