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); }
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); }
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]); }
internal SpecifyDateTimeDegree GetSpecifyDegree() { SpecifyDateTimeDegree degree = SpecifyDateTimeDegree.ToDay; switch (selectedDegree) { case "月": degree = SpecifyDateTimeDegree.ToMonth; break; case "年": degree = SpecifyDateTimeDegree.ToYear; break; default: break; } return(degree); }
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; } }
public DatePicker(SpecifyDateTimeDegree degree) { InitializeComponent(); calendarCtl.DisplayMode = GetDisplayMode(degree); }