コード例 #1
0
        public static Minutz.Models.ViewModels.MeetingViewModel ToMeetingViewModel(this Models.MeetingItemViewModel model)
        {
            var meetingId = model.Id == null?Guid.NewGuid() : Guid.Parse(model.Id);

            if (string.IsNullOrEmpty(model.Tag))
            {
                model.Tag = string.Empty;
            }
            if (string.IsNullOrEmpty(model.Purpose))
            {
                model.Purpose = string.Empty;
            }
            if (string.IsNullOrEmpty(model.Outcome))
            {
                model.Outcome = string.Empty;
            }
            if (string.IsNullOrEmpty(model.ReacuranceType))
            {
                model.ReacuranceType = string.Empty;
            }
            if (model.Date == DateTime.MinValue || model.Date == null)
            {
                model.Date = DateTime.UtcNow;
            }
            if (model.UpdatedDate == DateTime.MinValue || model.UpdatedDate == null)
            {
                model.UpdatedDate = DateTime.UtcNow;
            }
            if (string.IsNullOrEmpty(model.TimeZone))
            {
                model.TimeZone = string.Empty;
            }
            var result = new Minutz.Models.ViewModels.MeetingViewModel
            {
                Date           = model.Date,
                Duration       = model.Duration,
                Id             = meetingId.ToString(),
                IsFormal       = model.IsFormal,
                IsLocked       = model.IsLocked,
                IsPrivate      = model.IsPrivate,
                IsRecurrence   = model.IsReacurance,
                MeetingOwnerId = model.MeetingOwnerId,
                Name           = model.Name,
                Outcome        = model.Outcome,
                Purpose        = model.Purpose,
                Status         = model.Status,
                RecurrenceType = int.Parse(model.ReacuranceType),
                //Tag =  model.Tag,
                Time        = model.Time,
                TimeZone    = model.TimeZone,
                UpdatedDate = model.UpdatedDate,
                AvailableAttendeeCollection = new List <MeetingAttendee>(),
                MeetingActionCollection     = new List <MinutzAction>(),
                MeetingAgendaCollection     = new List <MeetingAgenda>(),
                MeetingAttachmentCollection = new List <MeetingAttachment>(),
                MeetingAttendeeCollection   = new List <MeetingAttendee>(),
                MeetingNoteCollection       = new List <MeetingNote>(),
                MeetingDecisionCollection   = new List <MinutzDecision>()
            };

            return(result);
        }
コード例 #2
0
 public static bool IsValid(this Models.MeetingItemViewModel viewItemModel)
 {
     return(true);
 }