public void Update(int workHours, int extraWorkHours, ScheduleOption scheduleOption, string projectId) { this.WorkHours = workHours; this.ExtraWorkHours = extraWorkHours; this.ScheduleOption = scheduleOption; this.ProjectId = projectId; }
public string GetShceduleOptionName(ScheduleOption scheduleOption) { string name = scheduleOption .GetType() .GetMember(scheduleOption.ToString()) .First() .GetCustomAttribute <DisplayAttribute>().Name; return(name); }
public static Schedule Create( DateTime date, ScheduleOption scheduleOption, string employeeId, string projectId, int workHours = 8, int extraWorkHours = 0) { if (scheduleOption != ScheduleOption.AtWork) { projectId = null; } var schedule = new Schedule() { Date = date, ScheduleOption = scheduleOption, EmployeeId = employeeId, ProjectId = projectId, WorkHours = workHours, ExtraWorkHours = extraWorkHours }; Validate(schedule); return(schedule); }