Пример #1
0
        public void AddDayInfo(DayInfo day_info)
        {
            name = day_info.name;
            int day = day_info.date.Day;

            date_info.Add(day, day_info);
        }
Пример #2
0
        public void AddDayInfo(IRow row)
        {
            RowInfo row_info = new RowInfo(row);
            DayInfo day_info = new DayInfo(row_info);

            name = row_info.name;
            int day = row_info.date.Day;

            date_info.Add(day, day_info);
        }
Пример #3
0
        // private void InitPlayerInfo(string name, DateTime time_start, DateTime time_end, int day)
        private void InitPlayerInfo(RowInfo row_info)
        {
            DayInfo day_info = new DayInfo(row_info);

            PlayerInfo player_info;

            if (AllPlayer.all_player_info.ContainsKey(row_info.name))
            {
                player_info = AllPlayer.all_player_info[row_info.name];
            }
            else
            {
                player_info = new PlayerInfo();
                player_info.AddDayInfo(day_info);
                AllPlayer.all_player_info.Add(row_info.name, player_info);
            }
        }
Пример #4
0
        public static bool IsAllowance(DayInfo day_info)
        {
            if (day_info.no_sign_out)
            {
                return(false);
            }
            if (IsOffday(day_info.date.Day))
            {
                return(true);
            }

            DateTime time = day_info.time_sign_out;
            TimeSpan end  = new TimeSpan(time.Hour, time.Minute, time.Second);
            TimeSpan span = new TimeSpan(21, 0, 0);

            return(end >= span);
        }
Пример #5
0
        public static bool IsDeductionLater(DayInfo day_info)
        {
            if (!day_info.is_later)
            {
                return(false);
            }
            if (IsOffday(day_info.date.Day))
            {
                return(false);
            }
            if (day_info.no_sign_in)
            {
                return(false);
            }
            DateTime time     = day_info.time_sign_in;
            TimeSpan start    = new TimeSpan(time.Hour, time.Minute, time.Second);
            TimeSpan span     = new TimeSpan(9, 35, 0);
            TimeSpan span_tmp = new TimeSpan(10, 5, 0);

            if (day_info.date.Day == 1)
            {
                return(false);
            }
            else
            {
                Console.WriteLine(">>>");
                PlayerInfo player_info = AllPlayer.all_player_info[day_info.name];
                DayInfo    info        = player_info.GetDayInfo(day_info.date.Day - 1);//前一天
                bool       t           = info.is_workday && info.is_allowance;
                if (t)
                {
                    return(start >= span && start <= span_tmp);
                }
                else
                {
                    return(false);
                }
            }
        }