コード例 #1
0
ファイル: Diary.cs プロジェクト: RHMGLtd/sourcecode
 private void BuildDiary(DateTime target)
 {
     FirstDayOfMonth = new DateTime(target.Year, target.Month, 1);
     var line = new DiaryLine();
     Lines.Add(line);
     var date = FirstDayOfMonth;
     line.Entries.Add(new DiaryEntry
                          {
                              Date = date
                          });
     date = date.AddDays(1);
     while (date.Month == FirstDayOfMonth.Month)
     {
         if (date.DayOfWeek == DayOfWeek.Monday)
         {
             line = new DiaryLine();
             Lines.Add(line);
         }
         line.Entries.Add(new DiaryEntry
         {
             Date = date
         });
         date = date.AddDays(1);
     }
 }
コード例 #2
0
ファイル: GigProvider.cs プロジェクト: RHMGLtd/sourcecode
 public DiaryLine Week(DateTime date)
 {
     var result = new DiaryLine();
     for (var d = date.GetMondayOfWeek(); d <= date.GetSundayOfWeek(); d = d.AddDays(1))
     {
         result.Entries.Add(GetEntry(d));
     }
     return result;
 }
コード例 #3
0
        public void CreateCheckLineFromString()
        {
            //arrange
            string s = "InsertCheckLine(True, 'Ensure the statement of affairs does not disclose personal information', '', '', '', '', '', '15-SoA', 30, '', 6, 0);";

            //act
            DiaryLine line = new DiaryLine(s);

            //assert
            Assert.AreEqual("Ensure the statement of affairs does not disclose personal information", line.Description);
            Assert.AreEqual(30, line.Role);
            Assert.AreEqual(15, line.Category.SortOrder);
            Assert.AreEqual(0, line.RecurringMonthsToAdd);
            Assert.AreEqual(LineType.Check, line.TypeOfLine);
        }
コード例 #4
0
        public void CreateDiaryLineFromString()
        {
            //arrange
            string s = "InsertDiaryLine(True, '01', appdate, appdate, mplus(appdate,2)+7, 'Request that one or more of the current directors submit a SoA', '', 'DOCX_ADMADM315_Action', '', '2.28', '', '15-SoA', 30, '', 1, 0);";

            //act
            DiaryLine line = new DiaryLine(s);

            //assert
            Assert.AreEqual(7, line.DueDate.DaysToAdd);
            Assert.AreEqual("appdate", line.PromptDate.BaseDate.DisplayName);
            Assert.AreEqual("Request that one or more of the current directors submit a SoA", line.Description);
            Assert.AreEqual(30, line.Role);
            Assert.AreEqual(15, line.Category.SortOrder);
            Assert.AreEqual(0, line.RecurringMonthsToAdd);
            Assert.AreEqual("2.28", line.RuleLink);
            Assert.AreEqual("01", line.LineClass);
            Assert.AreEqual("DOCX_ADMADM315_Action", line.DocumentLink);
            Assert.AreEqual(LineType.Diary, line.TypeOfLine);
        }