Exemplo n.º 1
0
        public void AllowToDoAction(User actionOwner)
        {
            if(actionOwner.UserName!=this.UserName)
                throw new Exception("User Cant do the action");

            
        }
Exemplo n.º 2
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.º 3
0
 public IEnumerable<Meeting> GetMeetinginDuration(DateTime startDate, int duration, User creatorUser)
 {
     var queryStartDate = startDate;
     var queryEndDate = queryStartDate.AddHours(duration);
     return ctx.Meetings.Where(
         m => m.ActionType != EntityActionType.Delete &&
              m.CreatorUser.UserName == creatorUser.UserName &&
              (
                  (queryStartDate <= m.StartDate && m.StartDate <= queryEndDate) ||
                  (queryStartDate <= DbFunctions.AddHours(m.StartDate, m.Duration) && DbFunctions.AddHours(m.StartDate, m.Duration) <= queryEndDate)
              )
         );
 }
Exemplo n.º 4
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.º 5
0
 public void Delete(User user)
 {
     ctx.Users.Remove(user);
     ctx.SaveChanges();
 }
Exemplo n.º 6
0
 public void Update(User user)
 {
     ctx.SaveChanges();
 }
Exemplo n.º 7
0
 public void Create(User user)
 {
     ctx.Users.Add(user);
     ctx.SaveChanges();
 }
Exemplo n.º 8
0
 public virtual void Delete(AppType appType, User actionOwner)
 {
     CreatorUser.AllowToDoAction(actionOwner);
     var currentState = this.StateCode;
     base.Delete(appType);
     AddMeetingHistory(currentState,MeetingOperationEnum.Delete);
 }
Exemplo n.º 9
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.º 10
0
 public void Transfer(User actionOwner, DateTime startDate, int duration)
 {
     if (!IsMeetingDateTimeChanged(startDate, duration)) return;
     CreatorUser.AllowToDoAction(actionOwner);
     var currentState = this.StateCode;
     State.Transfer(this,startDate,duration);
     AddMeetingHistory(currentState,MeetingOperationEnum.Transfer);
 }
Exemplo n.º 11
0
 public void Revert(User actionOwner, AppType appType)
 {
     CreatorUser.AllowToDoAction(actionOwner);
     var currentState = this.StateCode;
     State.Revert(this);
     AddMeetingHistory(currentState,MeetingOperationEnum.Revert);
     SyncByUpdate(appType);
 }
Exemplo n.º 12
0
 public void UpdateDuringMeeting(string decisions, string details, User actionOwner)
 {
     this.CreatorUser.AllowToDoAction(actionOwner);
     Decisions = decisions;
     Details = details;
 }
Exemplo n.º 13
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);
 }
Exemplo n.º 14
0
 public void CreateUser(string userName)
 {
     var user=new User(userName);
     userRepository.Create(user);
 }