Exemplo n.º 1
0
        public WorkingMeeting(string subject,
                                    DateTime startDate,
                                    int duration,
                                    string description,
                                    Location location, string attendeesName, string agenda, Guid syncId, AppType appType, User creator)
            : base(subject, startDate, duration, description, location, attendeesName, agenda, syncId, appType, creator)
        {

        }
Exemplo n.º 2
0
        public void CreateNonWorkingMeeting(CreateNonWorkingMeetingCmd command)
        {
            var creator = userRepository.GetBy(command.ActionOwnerUserName);
            var location = new Location(command.LocationAddress, command.LocationLatitude, command.LocationLongitude);

            var meeting = new NoneWorkingMeeting(command.Subject, command.StartDate, command.Duration,
                command.Description, location, command.Attendees, command.Agenda, command.SyncId, command.AppType,
                creator);
            if (command.Reminder != null)
                meeting.AddReminder(command.Reminder.ReminderType, command.Reminder.ReminderTimeType,
                    command.Reminder.RepeatingType, command.Reminder.CustomReminderTime);

            meetingRepository.Create(meeting);
        }
Exemplo n.º 3
0
 protected Meeting(string subject,
     DateTime startDate,
     int duration,
     string description,
     Location location, string attendeesName, string agenda, Guid syncId, AppType appType, User creator)
     : base(syncId, appType)
 {
     CreatorUser = creator;
     State = MeetingState.Scheduled;
     SetMeetingDateTime(startDate, duration);
     setProperties(subject, description,
         location, attendeesName, agenda);
     AddMeetingHistory(StateCode,MeetingOperationEnum.Create);
     SetInitializedState(appType);
     
 }
Exemplo n.º 4
0
        public void ModifyWorkingMeeting(ModifyWorkingMeetingCmd command)
        {
            var actionOwner = userRepository.GetBy(command.ActionOwnerUserName);
            var meeting = getBy(command.Id, command.SyncId) as WorkingMeeting;
            if (meeting == null)
            {
                CreateWorkingMeeting(new CreateWorkingMeetingCmd
                {
                    SyncId = command.SyncId,
                    StartDate = command.StartDate,
                    Duration = command.Duration,
                    Agenda = command.Agenda,
                    Subject = command.Subject,
                    Reminder = command.Reminder,
                    Attendees = command.Attendees,
                    Description = command.Description,
                    LocationAddress = command.LocationAddress,
                    ActionOwnerUserName = command.ActionOwnerUserName,
                    LocationLatitude = command.LocationLatitude,
                    AppType = command.AppType,
                    LocationLongitude = command.LocationLongitude
                });
                meeting = (WorkingMeeting)getBy(command.Id, command.SyncId);
            }
            var location = new Location(command.LocationAddress, command.LocationLatitude, command.LocationLongitude);
            //todo: shit bazam inja 
            meeting.Update(command.Subject, command.StartDate, command.Duration, command.Description, location,
                command.Attendees, command.Agenda, command.AppType, actionOwner);
            if (command.Reminder != null)
                meeting.AddReminder(command.Reminder.ReminderType, command.Reminder.ReminderTimeType,
                    command.Reminder.RepeatingType, command.Reminder.CustomReminderTime);
            if (!string.IsNullOrWhiteSpace(command.Decisions) || !string.IsNullOrWhiteSpace(command.Details))
                meeting.UpdateDuringMeeting(command.Decisions, command.Details, actionOwner);
            if (command.Files != null && command.Files.Any())
                meeting.UpdateFiles(command.Files.Select(cf => new Tuple<string, string>(cf.ContentType, cf.Content)));
            else
                meeting.UpdateFiles(null);
            

            meetingRepository.Update(meeting);
        }
Exemplo n.º 5
0
        public void ModifyNonWorkingMeeting(ModifyNonWorkingMeetingCmd command)
        {
            var actionOwner = userRepository.GetBy(command.ActionOwnerUserName);
            var meeting = getBy(command.Id, command.SyncId) as NoneWorkingMeeting;
            if (meeting == null)
            {
                CreateNonWorkingMeeting(new CreateNonWorkingMeetingCmd
                {
                    SyncId = command.SyncId,
                    StartDate = command.StartDate,
                    Duration = command.Duration,
                    Agenda = command.Agenda,
                    Subject = command.Subject,
                    Reminder = command.Reminder,
                    Attendees = command.Attendees,
                    Description = command.Description,
                    LocationAddress = command.LocationAddress,
                    ActionOwnerUserName = command.ActionOwnerUserName,
                    LocationLatitude = command.LocationLatitude,
                    AppType = command.AppType,
                    LocationLongitude = command.LocationLongitude
                });
                meeting = (NoneWorkingMeeting)getBy(command.Id, command.SyncId);
            }

            var location = new Location(command.LocationAddress, command.LocationLatitude, command.LocationLongitude);
            meeting.Update(command.Subject, command.StartDate, command.Duration, command.Description, location,
                command.Attendees, command.Agenda, command.AppType, actionOwner);
            if (command.Reminder != null)
                meeting.AddReminder(command.Reminder.ReminderType, command.Reminder.ReminderTimeType,
                    command.Reminder.RepeatingType, command.Reminder.CustomReminderTime);
            meetingRepository.Update(meeting);
        }
Exemplo n.º 6
0
 public virtual void Update(string subject, DateTime startDate, int duration, string description,
     Location location, string attendeesName, string agenda, AppType appType, User actionOwner)
 {
     CreatorUser.AllowToDoAction(actionOwner);
     var currentState = this.StateCode;
     Transfer(actionOwner,startDate, duration);
     setProperties(subject,description,
         location, attendeesName, agenda);
     SyncByUpdate(appType);
     AddMeetingHistory(currentState,MeetingOperationEnum.Modify);
 }
Exemplo n.º 7
0
        private void setProperties(string subject, string description, Location location, string attendeesName,
            string agenda)
        {
            if (string.IsNullOrWhiteSpace(subject))
                throw new InvalidArgumentException("Meeting","Subject");
            Subject = subject;
            Description = description;
            Location = location;
            if (string.IsNullOrWhiteSpace(attendeesName))
                throw new InvalidArgumentException("Meeting", "attendeesName");
            Attendees = attendeesName;
            Agenda = agenda;

        }
Exemplo n.º 8
0
 public void Update(string subject, DateTime startDate, int duration, string description,
     string attendeesName, Location location, string agenda, AppType appType, User actionOwner)
 {
     base.Update(subject, startDate, duration, description, location, attendeesName, agenda, appType, actionOwner);
 }