private static void SetHalf(
            Context context,
            Dictionary <string, ControlData> hash,
            DateTime now,
            DateTime current,
            bool recordedTime,
            int diff)
        {
            var timePeriod = new Implem.Libraries.Classes.TimePeriod(
                Implem.Libraries.Classes.TimePeriod.Types.Half, current, diff);

            if (!recordedTime || timePeriod.From <= now)
            {
                hash.Add(
                    Period(timePeriod),
                    new ControlData((current.Half() == 0
                        ? Displays.Half1(
                                         context: context,
                                         data: current.Fy().ToString())
                        : Displays.Half2(
                                         context: context,
                                         data: current.Fy().ToString()))
                                    + InRange(timePeriod, now)));
            }
        }
示例#2
0
        private static void SetFy(
            Dictionary <string, ControlData> hash,
            DateTime now,
            DateTime current,
            bool recordedTime,
            int diff)
        {
            var timePeriod = new Implem.Libraries.Classes.TimePeriod(
                Implem.Libraries.Classes.TimePeriod.Types.Fy, current, diff);

            if (!recordedTime || timePeriod.From <= now)
            {
                hash.Add(
                    Period(timePeriod),
                    new ControlData(Displays.Fy(current.Fy().ToString()) + InRange(timePeriod, now)));
            }
        }
示例#3
0
        private static void SetMonth(
            Dictionary <string, ControlData> hash,
            DateTime now,
            DateTime current,
            bool recordedTime,
            int diff)
        {
            var timePeriod = new Implem.Libraries.Classes.TimePeriod(
                Implem.Libraries.Classes.TimePeriod.Types.Month, current, diff);

            if (!recordedTime || timePeriod.From <= now)
            {
                hash.Add(
                    Period(timePeriod),
                    new ControlData(current.ToString("y", Sessions.CultureInfo()) +
                                    InRange(timePeriod, now)));
            }
        }
 private static string InRange(Implem.Libraries.Classes.TimePeriod timePeriod, DateTime now)
 {
     return(timePeriod.InRange(now)
         ? " *"
         : string.Empty);
 }
 private static string Period(Implem.Libraries.Classes.TimePeriod timePeriod)
 {
     return
         (timePeriod.From.ToString() + "," +
          timePeriod.To.ToString("yyyy/M/d H:m:s.fff"));
 }