コード例 #1
0
ファイル: Schedule.cs プロジェクト: zszqwe/Wilson
 public void Update(int workHours, int extraWorkHours, ScheduleOption scheduleOption, string projectId)
 {
     this.WorkHours      = workHours;
     this.ExtraWorkHours = extraWorkHours;
     this.ScheduleOption = scheduleOption;
     this.ProjectId      = projectId;
 }
コード例 #2
0
ファイル: ScheduleSevice.cs プロジェクト: zszqwe/Wilson
        public string GetShceduleOptionName(ScheduleOption scheduleOption)
        {
            string name = scheduleOption
                          .GetType()
                          .GetMember(scheduleOption.ToString())
                          .First()
                          .GetCustomAttribute <DisplayAttribute>().Name;

            return(name);
        }
コード例 #3
0
ファイル: Schedule.cs プロジェクト: zszqwe/Wilson
        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);
        }