Пример #1
0
        public RunInfoTable GetRunInfo(string projectName, DateTime dateTime, SpecifyDateTimeDegree degree)
        {
            RunInfoTable runInfoTable = new RunInfoTable(projectName, dateTime, null);
            var          founddata    = DataBase.Select(runInfoTable); // this is the actual database operation

            return(founddata.Count > 0? founddata.First() :null);
        }
Пример #2
0
        public void GetCertainRunInfos(string projectName, DateTime dateTime, SpecifyDateTimeDegree degree)
        {
            AllRunInfos.Clear();
            var runInfos = databseHelper.GetRunInfo(projectName, dateTime, degree);

            runInfos.ForEach(x => AllRunInfos.Add(x));
            Debug.WriteLine(AllRunInfos.Count);
        }
Пример #3
0
        private CalendarMode GetDisplayMode(SpecifyDateTimeDegree degree)
        {
            Dictionary <SpecifyDateTimeDegree, CalendarMode> dict = new Dictionary <SpecifyDateTimeDegree, CalendarMode>();

            dict.Add(SpecifyDateTimeDegree.ToYear, CalendarMode.Decade);
            dict.Add(SpecifyDateTimeDegree.ToMonth, CalendarMode.Year);
            dict.Add(SpecifyDateTimeDegree.ToDay, CalendarMode.Month);
            return(dict[degree]);
        }
Пример #4
0
        internal SpecifyDateTimeDegree GetSpecifyDegree()
        {
            SpecifyDateTimeDegree degree = SpecifyDateTimeDegree.ToDay;

            switch (selectedDegree)
            {
            case "月":
                degree = SpecifyDateTimeDegree.ToMonth;
                break;

            case "年":
                degree = SpecifyDateTimeDegree.ToYear;
                break;

            default:
                break;
            }
            return(degree);
        }
Пример #5
0
        void SetTimeAccuracyDegree(SpecifyDateTimeDegree degree)
        {
            switch (degree)
            {
            case SpecifyDateTimeDegree.ToYear:
                Day   = null;
                Month = null;
                Time  = null;
                break;

            case SpecifyDateTimeDegree.ToMonth:
                Day  = null;
                Time = null;
                break;

            case SpecifyDateTimeDegree.ToDay:
                Time = null;
                break;
            }
        }
Пример #6
0
 public DatePicker(SpecifyDateTimeDegree degree)
 {
     InitializeComponent();
     calendarCtl.DisplayMode = GetDisplayMode(degree);
 }