private string GenerateConsultantsSalary(Entreprise entreprise, DateTime date) { string report = " - Consultants: \r \r"; foreach (Manager manager in entreprise.GetManagers().Values) { foreach (Consultant consultant in manager.GetConsultants().Values) { int bonus = (60000 + 500 * manager.NumberConsultant()) / 100; foreach (Mission mission in consultant.GetMissionsFromYear(date)) { int bounty = 250; Console.WriteLine("GENE SAL CON: " + mission.GetClient().GetType()); if (mission.GetClient() is Entreprise) { bounty = -10 * mission.GetDuration(); } bonus += bounty; } report += String.Format(" - {0} {1} - {2} €\r", consultant.GetFirstname(), consultant.GetLastname(), 30000 + bonus); } } return(report + "\r"); }
public override void GenerateReport(Entreprise entreprise, DateTime date) { String name = "HR Report" + " - " + this.ToString() + ".txt"; File HRDReport = new File(name); String txt = ""; Dictionary <IClient, List <List <String> > > data = new Dictionary <IClient, List <List <String> > >(); foreach (Consultant consultant in entreprise.GetConsultants().Values) { foreach (Mission mission in consultant.GetMissionHistory()) { IClient client = mission.GetClient(); List <String> info = new List <String>(); info.Add(consultant.ToString()); info.Add(mission.GetStart().ToString()); info.Add(mission.GetEnd().ToString()); data[client].Add(info); } } foreach (Client client in data.Keys) { txt += client.ToString(); txt += Environment.NewLine; txt += Environment.NewLine; foreach (List <String> mission in data[client]) { txt += mission.ToString(); txt += Environment.NewLine; } } HRDReport.SaveFile(txt); }
public override void GenerateReport(Entreprise entreprise, DateTime date) { Console.WriteLine("[FD] Generating Report"); File FDReport = new File("Financial Report - " + this.ToString() + date.ToString() + ".txt"); string report = String.Format("- Relevé des salaires au sein de {0} - {1}\r \r", entreprise.GetName(), date.Year); report += this.GenerateDirectorsSalary(entreprise, date) + this.GenerateManagersSalary(entreprise, date) + this.GenerateConsultantsSalary(entreprise, date); Console.Write(report); FDReport.SaveFile(report); }
static void Main(string[] args) { DateTime date = new DateTime(2017, 10, 23); String name = "GE"; Generator gen = new Generator(); Entreprise entreprise = gen.GenerateAll(name, date); InterfaceClient show = new InterfaceClient(entreprise); show.Start(); }
private string GenerateManagersSalary(Entreprise entreprise, DateTime date) { string report = " - Managers: \r \r"; foreach (Manager manager in entreprise.GetManagers().Values) { report += String.Format(" - {0} {1} - {2} €\r", manager.GetFirstname(), manager.GetLastname(), 60000 + 500 * manager.NumberConsultant()); } return(report + "\r"); }
private string GenerateDirectorsSalary(Entreprise entreprise, DateTime date) { string report = " - Directors: \r \r"; foreach (Director director in entreprise.GetDirectors().Values) { report += String.Format(" - {0} {1} - {2} - {3} €\r", director.GetFirstname(), director.GetLastname(), director.GetType(), 150000); } return(report + "\r"); }
// Generate all the info to initialise the entreprise public Entreprise GenerateAll(String entreprise, DateTime date) { this.Entreprise = new Entreprise(entreprise, date); Console.Write("[GEN] Entreprise Loaded" + Environment.NewLine); this.GenerateEmploye("EmployeFile.txt"); Console.Write("[GEN] Employees Loaded" + Environment.NewLine); Console.Write("Consultants : " + this.Entreprise.GetConsultants().Count + Environment.NewLine); Console.Write("Managers : " + this.Entreprise.GetManagers().Count + Environment.NewLine); Console.Write("Directors : " + this.Entreprise.GetDirectors().Count + Environment.NewLine); this.LinkConsultantandManager("LinkFile.txt"); Console.Write("[GEN] Consultants linked to Manager" + Environment.NewLine); this.GenerateClient("ClientFile.txt"); Console.Write("[GEN] Client Loaded" + Environment.NewLine); Console.Write("Clients : " + this.Entreprise.GetClients().Count + Environment.NewLine); this.GenerateMission("MissionFile.txt"); Console.Write("[GEN] Mission Loaded" + Environment.NewLine); return(this.Entreprise); }
public InterfaceClient(Entreprise entreprise) { this.Entreprise = entreprise; }
public virtual void GenerateReport(Entreprise entreprise, DateTime date) { }