예제 #1
0
        private static Notes.Notes MadeMonthRepeatNotes(string startHour, string startMinutes, string endHour,
                                                        string endMinutes,
                                                        string startRange,
                                                        string endRange, string nMonth, string ndayMonthEnum,
                                                        string monthDayTypeEnum, string content,
                                                        string shares, string pkid)
        {
            Notes.Notes note = new Notes.Notes();
            note.PKID              = Convert.ToInt32(pkid);
            note.Content           = content.Trim();
            note.Start             = Convert.ToDateTime(string.Format("2010-1-1 {0}:{1}", startHour, startMinutes));
            note.End               = Convert.ToDateTime(string.Format("2010-1-1 {0}:{1}", endHour, endMinutes));
            note.ShareSet          = new Share();
            note.ShareSet.NoteID   = note.PKID;
            note.ShareSet.Accounts = Share.toAccountList(shares);
            MonthRepeat repeat = new MonthRepeat();

            repeat.NMonth           = Convert.ToInt32(nMonth);
            repeat.MonthDayTypeEnum = MonthDayTypeEnum.GetByValue(Convert.ToInt32(monthDayTypeEnum));
            repeat.NDayMonthEnum    = NDayMonthEnum.GetByValue(Convert.ToInt32(ndayMonthEnum));
            repeat.RangeStart       = Convert.ToDateTime(startRange);
            if (!string.IsNullOrEmpty(endRange.Trim()))
            {
                repeat.RangeEnd = Convert.ToDateTime(endRange);
            }
            note.RepeatType = repeat;
            return(note);
        }
예제 #2
0
 public NotesViewModel(Notes.Notes note)
 {
     _Note = note;
     if (_Note.RepeatType is NoRepeat)
     {
         _NoRepeat = (NoRepeat)_Note.RepeatType;
     }
     else if (_Note.RepeatType is DayRepeat)
     {
         _DayRepeat = (DayRepeat)_Note.RepeatType;
     }
     else if (_Note.RepeatType is WeekRepeat)
     {
         _WeekRepeat = (WeekRepeat)_Note.RepeatType;
     }
     else if (_Note.RepeatType is MonthRepeat)
     {
         _MonthRepeat = (MonthRepeat)_Note.RepeatType;
     }
 }