Пример #1
0
        private static Notes.Notes MadeWeekRepeatNotes(string startHour, string startMinutes, string endHour,
                                                       string endMinutes,
                                                       string startRange,
                                                       string endRange, string nweek, string weeks, 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);
            WeekRepeat repeat = new WeekRepeat();

            repeat.NWeek    = Convert.ToInt32(nweek);
            repeat.WeekList = new List <string>(weeks.Split('|'));
            if (string.IsNullOrEmpty(repeat.WeekList[repeat.WeekList.Count - 1]))
            {
                repeat.WeekList.RemoveAt(repeat.WeekList.Count - 1);
            }
            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;
     }
 }