Hi, everyone - this is my first post, so be kind . I'm building a practice repository program for a non-existent insurance companies. The premise of the project is that I need a program that the "Managers" can use to access their software developer and software developer team information. I've built a lot of the UI, one of the POCOS, and two of the repositories. Everything is still missing CRUD methodology. My goal for this is for the "Managers" to be able to add/remove team members using their name or ID information. They need to be able to see a list of existing developers and add developers to existing teams. I've included the code below that I have written, so far. I'm missing the Dev Team Pocos (I don't know exactly how to get started on that and would appreciate some help). I would also love some help with the CRUD methods for both repo's and the UI. If I've explained anything terribly I'm sorry and I will elaborate if I need to. Thanks for your help in advance!
Program UI:
using System.Collections.Generic;
public class Developer
{
public int Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public bool HasPluralSight { get; set; }
public bool NeedsLicense { get; set; }
}
public class Team
{
public string TeamName { get; set; }
// Add any other properties related to a team here
}
public class DevTeamRepo
{
private int Counter = 1;
private readonly List<Team> _teams = new List<Team>();
public DevTeamRepo()
{
SeedData();
}
private void SeedData()
{
List<Developer> group1 = new List<Developer>();
List<Developer> group2 = new List<Developer>();
List<Developer> group3 = new List<Developer>();
Developer developer1 = new Developer();
developer1.Id = Counter++;
developer1.Name = "Mick";
developer1.Email = "(e-mail address removed)";
developer1.HasPluralSight = false;
developer1.NeedsLicense = false;
group1.Add(developer1);
Developer developer2 = new Developer();
developer2.Id = Counter++;
developer2.Name = "Chloe";
developer2.Email = "(e-mail address removed)";
developer2.HasPluralSight = true;
developer2.NeedsLicense = false;
group1.Add(developer2);
Developer developer3 = new Developer();
developer3.Id = Counter++;
developer3.Name = "Dan";
developer3.Email = "(e-mail address removed)";
developer3.HasPluralSight = false;
developer3.NeedsLicense = true;
group1.Add(developer3);
Developer developer4 = new Developer();
developer4.Id = Counter++;
developer4.Name = "Lex";
developer4.Email = "(e-mail address removed)";
developer4.HasPluralSight = true;
developer4.NeedsLicense = false;
group2.Add(developer4);
Developer developer5 = new Developer();
developer5.Id = Counter++;
developer5.Name = "Iggy";
developer5.Email = "(e-mail address removed)";
developer5.HasPluralSight = false;
developer5.NeedsLicense = false;
group2.Add(developer5);
Developer developer6 = new Developer();
developer6.Id = Counter++;
developer6.Name = "Moneypenny";
developer6.Email = "(e-mail address removed)";
developer6.HasPluralSight = true;
developer6.NeedsLicense = false;
group2.Add(developer6);
Developer developer7 = new Developer();
developer7.Id = Counter++;
developer7.Name = "James";
developer7.Email = "(e-mail address removed)";
developer7.HasPluralSight = true;
developer7.NeedsLicense = false;
group3.Add(developer7);
Developer developer8 = new Developer();
developer8.Id = Counter++;
developer8.Name = "Hailey";
developer8.Email = "(e-mail address removed)";
developer8.HasPluralSight = true;
developer8.NeedsLicense = false;
group3.Add(developer8);
Developer developer9 = new Developer();
developer9.Id = Counter++;
developer9.Name = "Lemmy";
developer9.Email = "(e-mail address removed)";
developer9.HasPluralSight = false;
developer9.NeedsLicense = true;
group3.Add(developer9);
}
public void AddTeam(Team team)
{
_teams.Add(team);
}
public void RemoveTeam(string teamName)
{
Team team = GetTeamByName(teamName);
if (team != null)
{
_teams.Remove(team);
}
}
public Team GetTeamByName(string teamName)
{
foreach (Team team in _teams)
{
if (team.TeamName == teamName)
{
return team;
}
}
return null;
}
public List<Team> GetTeams()
{
return _teams;
}
}
Developer POCOS:
class Developer
{
public int id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public bool HasPluralSight { get; set; }
public bool NeedsLicense { get; set; }
}
Developer Repo:
using System.Collections.Generic;
public class Developer
{
public int Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public bool HasPluralSight { get; set; }
public bool NeedsLicense { get; set; }
}
public class Team
{
public string TeamName { get; set; }
// Add any other properties related to a team here
}
public class DevTeamRepo
{
private int Counter = 1;
private readonly List<Team> _teams = new List<Team>();
public DevTeamRepo()
{
SeedData();
}
private void SeedData()
{
List<Developer> group1 = new List<Developer>();
List<Developer> group2 = new List<Developer>();
List<Developer> group3 = new List<Developer>();
Developer developer1 = new Developer();
developer1.Id = Counter++;
developer1.Name = "Mick";
developer1.Email = "(e-mail address removed)";
developer1.HasPluralSight = false;
developer1.NeedsLicense = false;
group1.Add(developer1);
Developer developer2 = new Developer();
developer2.Id = Counter++;
developer2.Name = "Chloe";
developer2.Email = "(e-mail address removed)";
developer2.HasPluralSight = true;
developer2.NeedsLicense = false;
group1.Add(developer2);
Developer developer3 = new Developer();
developer3.Id = Counter++;
developer3.Name = "Dan";
developer3.Email = "(e-mail address removed)";
developer3.HasPluralSight = false;
developer3.NeedsLicense = true;
group1.Add(developer3);
Developer developer4 = new Developer();
developer4.Id = Counter++;
developer4.Name = "Lex";
developer4.Email = "(e-mail address removed)";
developer4.HasPluralSight = true;
developer4.NeedsLicense = false;
group2.Add(developer4);
Developer developer5 = new Developer();
developer5.Id = Counter++;
developer5.Name = "Iggy";
developer5.Email = "(e-mail address removed)";
developer5.HasPluralSight = false;
developer5.NeedsLicense = false;
group2.Add(developer5);
Developer developer6 = new Developer();
developer6.Id = Counter++;
developer6.Name = "Moneypenny";
developer6.Email = "(e-mail address removed)";
developer6.HasPluralSight = true;
developer6.NeedsLicense = false;
group2.Add(developer6);
Developer developer7 = new Developer();
developer7.Id = Counter++;
developer7.Name = "James";
developer7.Email = "(e-mail address removed)";
developer7.HasPluralSight = true;
developer7.NeedsLicense = false;
group3.Add(developer7);
Developer developer8 = new Developer();
developer8.Id = Counter++;
developer8.Name = "Hailey";
developer8.Email = "(e-mail address removed)";
developer8.HasPluralSight = true;
developer8.NeedsLicense = false;
group3.Add(developer8);
Developer developer9 = new Developer();
developer9.Id = Counter++;
developer9.Name = "Lemmy";
developer9.Email = "(e-mail address removed)";
developer9.HasPluralSight = false;
developer9.NeedsLicense = true;
group3.Add(developer9);
}
public void AddTeam(Team team)
{
_teams.Add(team);
}
public void RemoveTeam(string teamName)
{
Team team = GetTeamByName(teamName);
if (team != null)
{
_teams.Remove(team);
}
}
public Team GetTeamByName(string teamName)
{
foreach (Team team in _teams)
{
if (team.TeamName == teamName)
{
return team;
}
}
return null;
}
public List<Team> GetTeams()
{
return _teams;
}
}
Developer Team Repo:
public Team GetTeamByName(string teamName)
{
foreach (Team team in _teams)
{
if (team.TeamName == teamName)
{
return team;
}
}
return null;
}
public List<Team> GetTeams()
{
return _teams;
}
}
Program UI:
using System.Collections.Generic;
public class Developer
{
public int Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public bool HasPluralSight { get; set; }
public bool NeedsLicense { get; set; }
}
public class Team
{
public string TeamName { get; set; }
// Add any other properties related to a team here
}
public class DevTeamRepo
{
private int Counter = 1;
private readonly List<Team> _teams = new List<Team>();
public DevTeamRepo()
{
SeedData();
}
private void SeedData()
{
List<Developer> group1 = new List<Developer>();
List<Developer> group2 = new List<Developer>();
List<Developer> group3 = new List<Developer>();
Developer developer1 = new Developer();
developer1.Id = Counter++;
developer1.Name = "Mick";
developer1.Email = "(e-mail address removed)";
developer1.HasPluralSight = false;
developer1.NeedsLicense = false;
group1.Add(developer1);
Developer developer2 = new Developer();
developer2.Id = Counter++;
developer2.Name = "Chloe";
developer2.Email = "(e-mail address removed)";
developer2.HasPluralSight = true;
developer2.NeedsLicense = false;
group1.Add(developer2);
Developer developer3 = new Developer();
developer3.Id = Counter++;
developer3.Name = "Dan";
developer3.Email = "(e-mail address removed)";
developer3.HasPluralSight = false;
developer3.NeedsLicense = true;
group1.Add(developer3);
Developer developer4 = new Developer();
developer4.Id = Counter++;
developer4.Name = "Lex";
developer4.Email = "(e-mail address removed)";
developer4.HasPluralSight = true;
developer4.NeedsLicense = false;
group2.Add(developer4);
Developer developer5 = new Developer();
developer5.Id = Counter++;
developer5.Name = "Iggy";
developer5.Email = "(e-mail address removed)";
developer5.HasPluralSight = false;
developer5.NeedsLicense = false;
group2.Add(developer5);
Developer developer6 = new Developer();
developer6.Id = Counter++;
developer6.Name = "Moneypenny";
developer6.Email = "(e-mail address removed)";
developer6.HasPluralSight = true;
developer6.NeedsLicense = false;
group2.Add(developer6);
Developer developer7 = new Developer();
developer7.Id = Counter++;
developer7.Name = "James";
developer7.Email = "(e-mail address removed)";
developer7.HasPluralSight = true;
developer7.NeedsLicense = false;
group3.Add(developer7);
Developer developer8 = new Developer();
developer8.Id = Counter++;
developer8.Name = "Hailey";
developer8.Email = "(e-mail address removed)";
developer8.HasPluralSight = true;
developer8.NeedsLicense = false;
group3.Add(developer8);
Developer developer9 = new Developer();
developer9.Id = Counter++;
developer9.Name = "Lemmy";
developer9.Email = "(e-mail address removed)";
developer9.HasPluralSight = false;
developer9.NeedsLicense = true;
group3.Add(developer9);
}
public void AddTeam(Team team)
{
_teams.Add(team);
}
public void RemoveTeam(string teamName)
{
Team team = GetTeamByName(teamName);
if (team != null)
{
_teams.Remove(team);
}
}
public Team GetTeamByName(string teamName)
{
foreach (Team team in _teams)
{
if (team.TeamName == teamName)
{
return team;
}
}
return null;
}
public List<Team> GetTeams()
{
return _teams;
}
}
Developer POCOS:
class Developer
{
public int id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public bool HasPluralSight { get; set; }
public bool NeedsLicense { get; set; }
}
Developer Repo:
using System.Collections.Generic;
public class Developer
{
public int Id { get; set; }
public string Name { get; set; }
public string Email { get; set; }
public bool HasPluralSight { get; set; }
public bool NeedsLicense { get; set; }
}
public class Team
{
public string TeamName { get; set; }
// Add any other properties related to a team here
}
public class DevTeamRepo
{
private int Counter = 1;
private readonly List<Team> _teams = new List<Team>();
public DevTeamRepo()
{
SeedData();
}
private void SeedData()
{
List<Developer> group1 = new List<Developer>();
List<Developer> group2 = new List<Developer>();
List<Developer> group3 = new List<Developer>();
Developer developer1 = new Developer();
developer1.Id = Counter++;
developer1.Name = "Mick";
developer1.Email = "(e-mail address removed)";
developer1.HasPluralSight = false;
developer1.NeedsLicense = false;
group1.Add(developer1);
Developer developer2 = new Developer();
developer2.Id = Counter++;
developer2.Name = "Chloe";
developer2.Email = "(e-mail address removed)";
developer2.HasPluralSight = true;
developer2.NeedsLicense = false;
group1.Add(developer2);
Developer developer3 = new Developer();
developer3.Id = Counter++;
developer3.Name = "Dan";
developer3.Email = "(e-mail address removed)";
developer3.HasPluralSight = false;
developer3.NeedsLicense = true;
group1.Add(developer3);
Developer developer4 = new Developer();
developer4.Id = Counter++;
developer4.Name = "Lex";
developer4.Email = "(e-mail address removed)";
developer4.HasPluralSight = true;
developer4.NeedsLicense = false;
group2.Add(developer4);
Developer developer5 = new Developer();
developer5.Id = Counter++;
developer5.Name = "Iggy";
developer5.Email = "(e-mail address removed)";
developer5.HasPluralSight = false;
developer5.NeedsLicense = false;
group2.Add(developer5);
Developer developer6 = new Developer();
developer6.Id = Counter++;
developer6.Name = "Moneypenny";
developer6.Email = "(e-mail address removed)";
developer6.HasPluralSight = true;
developer6.NeedsLicense = false;
group2.Add(developer6);
Developer developer7 = new Developer();
developer7.Id = Counter++;
developer7.Name = "James";
developer7.Email = "(e-mail address removed)";
developer7.HasPluralSight = true;
developer7.NeedsLicense = false;
group3.Add(developer7);
Developer developer8 = new Developer();
developer8.Id = Counter++;
developer8.Name = "Hailey";
developer8.Email = "(e-mail address removed)";
developer8.HasPluralSight = true;
developer8.NeedsLicense = false;
group3.Add(developer8);
Developer developer9 = new Developer();
developer9.Id = Counter++;
developer9.Name = "Lemmy";
developer9.Email = "(e-mail address removed)";
developer9.HasPluralSight = false;
developer9.NeedsLicense = true;
group3.Add(developer9);
}
public void AddTeam(Team team)
{
_teams.Add(team);
}
public void RemoveTeam(string teamName)
{
Team team = GetTeamByName(teamName);
if (team != null)
{
_teams.Remove(team);
}
}
public Team GetTeamByName(string teamName)
{
foreach (Team team in _teams)
{
if (team.TeamName == teamName)
{
return team;
}
}
return null;
}
public List<Team> GetTeams()
{
return _teams;
}
}
Developer Team Repo:
public Team GetTeamByName(string teamName)
{
foreach (Team team in _teams)
{
if (team.TeamName == teamName)
{
return team;
}
}
return null;
}
public List<Team> GetTeams()
{
return _teams;
}
}