I have this class:
public class CalendarData_Day
{
public DateTime Date { get; set; }
public DayType TypeOfDay { get; set; }
public bool Choose { get; set; }
public CalendarData_Day(DateTime datum) : this(datum, DayType.Normal, true)
{
}
public CalendarData_Day(DateTime datum, DayType typDne) : this(datum, typDne, true)
{
}
public CalendarData_Day(DateTime datum, DayType typDne, bool vybran)
{
this.Date = datum;
this.TypeOfDay = typDne;
this.Choose = vybran;
}
}
and I want in second constructor check if DayType is Weekend and if it is then not send to Choose true but false. Anybody knows how can I do it? I know I can add to last constructor if and checked but it doesn´t seem right for me. I think there is better way I think that I should do it other way or is this in last contructor okay:
if (TypeOfDay == DayType.Weekend)
this.Choose = false;
I know it´s working but I don´t know it is right way.
Edit: I am sorry for that I don´t explained everything. There is more than 2 DayTypes, lets say there is Holiday, Work, ... And I want that user can call class with just second constructor and if DayType would be Weekend or Holiday then Choose must be false but if it would be Normal or Work it should be true or user must user last contructor and set DayType to Work and Choose to false. It is complicated I am sorry I should wrote this first time.