I am doing my lab hw. There is a part that I couldn't handle it: "The company wants to give bonus 200 TL to the employee if the current week is the one in which the employee’s birthday occurs." I am trying to write a method that returns boolean, if the birth date in the current week. Then, I realised that the method I have done is just checking if the current day is equalt to birth date. What I want is if the current payment week if inculdes someone's birthdate. I think I need to use a calendar or something like that. Since the program is temp, each day will be payment day. I mean if the birthday is in the same week with DateTime.Today then return true. And add 200 TL more to the salary.
protected bool isBirthDay()
{
try
{
string today = DateTime.Today.
string birth_date = birthDate.ToString("d");
if (today[0]== birth_date[0] && today[1]== birth_date[1] && today[3]==birth_date[3] && today[4]==birth_date[4])
return true;
return false;
}
catch (Exception e)
{
Console.WriteLine(e);
throw;
}
}