Skip to content

Instantly share code, notes, and snippets.

@mhkoca
Created September 23, 2019 19:21
Show Gist options
  • Save mhkoca/359124aae23d108a6593cdf3b1501416 to your computer and use it in GitHub Desktop.
Save mhkoca/359124aae23d108a6593cdf3b1501416 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
namespace DictionaryTraining
{
public class Program
{
static void Main(string[] args)
{
Reporter reporter = new Reporter();
ReportType reportType = ReportType.Monthly;
PrepareReport(reportType);
Console.ReadLine();
}
private static void PrepareReport(ReportType reportType)
{
Reporter reporter = new Reporter();
if (reportType == ReportType.Daily)
{
reporter.GetDailyReport();
}
else if (reportType == ReportType.Weekly)
{
reporter.GetWeeklyReport();
}
else if (reportType == ReportType.Monthly)
{
reporter.GetMonthlyReport();
}
else if (reportType == ReportType.Annual)
{
reporter.GetAnnualReport();
}
}
}
public class Reporter
{
public void GetDailyReport()
{
Console.WriteLine("Daily report is preparing...");
}
public void GetWeeklyReport()
{
Console.WriteLine("Weekly report is preparing...");
}
public void GetMonthlyReport()
{
Console.WriteLine("Monthly report is preparing...");
}
public void GetAnnualReport()
{
Console.WriteLine("Annual report is preparing...");
}
}
public enum ReportType
{
Daily,
Weekly,
Monthly,
Annual
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment