Example #1
0
        public static void onMeetingEnd(LiveMeeting meeting)
        {
            MeetingEnd payload = new MeetingEnd();

            payload.ConferenceId = meeting.Id;
            payload.StartTime    = meeting.openTime;
            payload.StartTime    = meeting.closeTime;
            meeting.Clients.ForEach(c =>
            {
                MeetingParticipant p = new MeetingParticipant();
                p.ParticipantId      = c.BGId;
                p.Present            = c.joined;
                if (c.joined)
                {
                    p.JoinTime  = c.joinTime;
                    p.LeaveTime = c.leaveTime;
                }
                payload.Participants.Add(p);
            });

            string callbackRoot = meeting.CallbackUrl;
            string url          = string.Format(Urls.meetingEndUrl, callbackRoot);

            PostHelper.PostJson(url, payload, Urls.authKey);
        }
Example #2
0
        public static MeetingParticipantModel ToModel(this MeetingParticipant entity)
        {
            UserModel userModel = null;

            if (entity.User != null)
            {
                userModel = new UserModel()
                {
                    Id          = entity.User.Id,
                    ChineseName = entity.User.ChineseName,
                    EnglishName = entity.User.EnglishName,
                    Email       = entity.User.Email,
                    Phone       = entity.User.Phone
                };
            }

            var model = new MeetingParticipantModel()
            {
                Id = entity.Id,
                MeetingCalendarId = entity.MeetingCalendarId,
                UserId            = entity.UserId,
                IsOptional        = entity.IsOptional,
                User = userModel
            };

            return(model);
        }
Example #3
0
    void RemoveParticipant(Player player)
    {
        MeetingParticipant oldParticipant = null;

        if (!participants.TryGetValue(player, out oldParticipant))
        {
            return;
        }

        GKMeetingMain.Log("Leaving meeting: " + player.displayName);

        participants.Remove(player);

        // set the index of the remaining participants
        foreach (var participant in participants.Values)
        {
            if (participant.index > oldParticipant.index)
            {
                participant.index--;
            }
        }

        // clean up
        Destroy(oldParticipant);
    }
Example #4
0
    // handler for when a player is speaking or silent in a voice chat
    void OnVoiceChatPlayerStateChanged(object sender, VoiceChatPlayerStateChangedEventArgs e)
    {
        MeetingParticipant participant = null;

        if (!participants.TryGetValue(e.player, out participant))
        {
            return;
        }

        participant.isSpeaking = (e.state == GKVoiceChatPlayerState.Speaking);
    }
Example #5
0
        public static MeetingParticipant ToEntity(this MeetingParticipantModel model)
        {
            var entity = new MeetingParticipant()
            {
                MeetingCalendarId = model.MeetingCalendarId,
                UserId            = model.UserId,
                IsOptional        = model.IsOptional
            };

            return(entity);
        }
        public static ObservableCollection<MeetingParticipant> GetMeetings(string EventId, string AttendeeWantId)
        {
            ObservableCollection<MeetingParticipant> Meetings = new ObservableCollection<MeetingParticipant>();

            SQLiteConnection sqlCon = new SQLiteConnection(Utilities.GetConnectionString());
            SQLiteCommand sqlCmd = new SQLiteCommand("SELECT * FROM Meetings WHERE EventId = @EventId AND AttendeeWantId = @AttendeeWantId", sqlCon);

            sqlCmd.Parameters.AddWithValue("@EventId", EventId);
            sqlCmd.Parameters.AddWithValue("@AttendeeWantId", AttendeeWantId);

            try
            {
                sqlCon.Open();

                SQLiteDataReader reader = sqlCmd.ExecuteReader();

                if (reader.HasRows)
                {
                    while (reader.Read())
                    {
                        MeetingParticipant ThisMeeting = new MeetingParticipant();

                        ThisMeeting.MeetingId = reader.GetInt32(0);
                        ThisMeeting.Id = reader.GetString(2);
                        ThisMeeting.Name = reader[3] != DBNull.Value ? reader.GetString(3) : string.Empty;
                        ThisMeeting.CompanyName = reader[4] != DBNull.Value ? reader.GetString(4) : string.Empty;
                        ThisMeeting.Role = reader[5] != DBNull.Value ? reader.GetString(5) : string.Empty;
                        ThisMeeting.Status = reader[6] != DBNull.Value ? reader.GetString(6) : string.Empty;
                        ThisMeeting.IsWalkin = reader.GetBoolean(7);
                        ThisMeeting.JobTitle = reader[8] != DBNull.Value ? reader.GetString(8) : string.Empty;
                        ThisMeeting.AllocatedTable = reader[9] != DBNull.Value ? reader.GetString(9) : string.Empty;
                        ThisMeeting.MeetingSlotStartTime = reader.GetDateTime(11);
                        ThisMeeting.MeetingSlotEndTime = reader.GetDateTime(12);
                        ThisMeeting.IsPrimary = reader.GetBoolean(13);
                        ThisMeeting.TableName = reader.GetString(14);

                        Meetings.Add(ThisMeeting);
                    }
                }
            }
            catch (Exception ex)
            {
                string Meesage = ex.Message;
            }
            finally
            {
                sqlCon.Close();
            }

            return Meetings;
        }
Example #7
0
        private void Scenario2Btn_Click(object sender, RoutedEventArgs e)
        {
            ResetMainWindow();
            //Strong Conflict Scenario
            MeetingNameInp.Text            = "Strong Conflict";
            MeetingAgendaInp.Text          = "Strong Conflict Testing";
            SlotPicker.SelectedIndex       = 0;
            MeetingDatePicker.SelectedDate = DateTime.Now.AddDays(1);
            LocationPicker.SelectedIndex   = 0;
            ImportancePicker.SelectedIndex = 2;

            CurrentMeeting.Name              = "Strong Conflict";
            CurrentMeeting.Agenda            = "Strong Conflict Testing";
            CurrentMeeting.ScheduledDate     = DateTime.Now.AddDays(1);
            CurrentMeeting.ScheduledTimeSlot = "Slot 1";
            CurrentMeeting.SelectedLocation  = "Location 1";
            CurrentMeeting.Importance        = Importance.Normal;

            var p1  = UsersCollection.GetAllUsers()[0];
            var mp1 = new MeetingParticipant()
            {
                Slots              = p1.Slots,
                UserName           = p1.UserName,
                RelativeImportance = Importance.Normal
            };
            var p2  = UsersCollection.GetAllUsers()[4];
            var mp2 = new MeetingParticipant()
            {
                Slots              = p2.Slots,
                UserName           = p2.UserName,
                RelativeImportance = Importance.VeryHigh
            };
            var p3  = UsersCollection.GetAllUsers()[5];
            var mp3 = new MeetingParticipant()
            {
                Slots              = p3.Slots,
                UserName           = p3.UserName,
                RelativeImportance = Importance.Low
            };

            CurrentMeeting.Participants.Add(mp1);
            CurrentMeeting.Participants.Add(mp2);
            CurrentMeeting.Participants.Add(mp3);

            AllUsersListBox.Items.RemoveAt(0);
            AllUsersListBox.Items.RemoveAt(3);
            AllUsersListBox.Items.RemoveAt(3);
            RequestedUsersListBox.Items.Add("User Number 1");
            RequestedUsersListBox.Items.Add("User Number 5");
            RequestedUsersListBox.Items.Add("User Number 6");
        }
Example #8
0
        private void Scenario1Btn_Click(object sender, RoutedEventArgs e)
        {
            //Weak Conflict Scenario
            ResetMainWindow();
            MeetingNameInp.Text            = "Weak Conflict";
            MeetingAgendaInp.Text          = "Weak Conflict Testing";
            SlotPicker.SelectedIndex       = 2;
            MeetingDatePicker.SelectedDate = new DateTime(2019, 06, 17);
            LocationPicker.SelectedIndex   = 0;
            ImportancePicker.SelectedIndex = 2;

            CurrentMeeting.Name              = "Weak Conflict";
            CurrentMeeting.Agenda            = "Weak Conflict Testing";
            CurrentMeeting.ScheduledDate     = new DateTime(2019, 06, 17);
            CurrentMeeting.ScheduledTimeSlot = "Slot 3";
            CurrentMeeting.SelectedLocation  = "Location 1";
            CurrentMeeting.Importance        = Importance.Normal;

            var p1  = UsersCollection.GetAllUsers()[2];
            var mp1 = new MeetingParticipant()
            {
                Slots              = p1.Slots,
                UserName           = p1.UserName,
                RelativeImportance = Importance.Normal
            };
            var p2  = UsersCollection.GetAllUsers()[3];
            var mp2 = new MeetingParticipant()
            {
                Slots              = p2.Slots,
                UserName           = p2.UserName,
                RelativeImportance = Importance.High
            };
            var p3  = UsersCollection.GetAllUsers()[4];
            var mp3 = new MeetingParticipant()
            {
                Slots              = p3.Slots,
                UserName           = p3.UserName,
                RelativeImportance = Importance.Low
            };

            CurrentMeeting.Participants.Add(mp1);
            CurrentMeeting.Participants.Add(mp2);
            CurrentMeeting.Participants.Add(mp3);

            AllUsersListBox.Items.RemoveAt(2);
            AllUsersListBox.Items.RemoveAt(2);
            AllUsersListBox.Items.RemoveAt(2);
            RequestedUsersListBox.Items.Add("User Number 3");
            RequestedUsersListBox.Items.Add("User Number 4");
            RequestedUsersListBox.Items.Add("User Number 5");
        }
Example #9
0
            internal static bool InsertAppointment(DateTime sdate, DateTime edate, DateTime stime, DateTime etime, string title, string username, string invitedUser, bool allday, string desc)
            {
                try
                {
                    using (boxEntities box = new boxEntities())
                    {
                        int userid = Profile.getUserID(username);
                        int inv    = Profile.getUserID(invitedUser);

                        Meeting meet = new Meeting();
                        meet.StartDate    = new DateTime(sdate.Year, sdate.Month, sdate.Day, stime.Hour, stime.Minute, stime.Second);
                        meet.EndDate      = new DateTime(edate.Year, edate.Month, edate.Day, etime.Hour, etime.Minute, etime.Second);
                        meet.MeetingTitle = title;
                        meet.MeetingDesc  = desc;
                        meet.Cal          = false;
                        meet.Mee          = false;
                        meet.AllDay       = allday;
                        meet.App          = true;
                        // additional

                        meet.Type = 0;

                        MeetingParticipant part1 = new MeetingParticipant();
                        part1.UserID    = userid;
                        part1.Role      = MeetingRoles.Creator.ToString();
                        part1.MeetingID = meet.MeetingID;
                        part1.Response  = MeetingReponse.Pending.ToString();
                        part1.Note      = "";
                        meet.MeetingParticipants.Add(part1);


                        MeetingParticipant invited = new MeetingParticipant();
                        invited.UserID    = inv;
                        invited.Role      = MeetingRoles.Attendee.ToString();
                        invited.MeetingID = meet.MeetingID;
                        invited.Response  = MeetingReponse.Pending.ToString();
                        invited.Note      = "";
                        meet.MeetingParticipants.Add(invited);

                        box.Meetings.AddObject(meet);

                        box.SaveChanges();
                        return(true);
                    }
                }
                catch
                {
                    return(false);
                }
            }
Example #10
0
            public static List <int> SaveParticipants(object[] obj, int meetingID)
            {
                using (boxEntities box = new boxEntities())
                {
                    List <int> Parties = new List <int>();
                    var        meeting = (from o in box.Meetings where o.MeetingID == meetingID select o).FirstOrDefault();
                    if (meeting != null)
                    {
                        foreach (var i in obj)
                        {
                            var item = (Dictionary <string, object>)i;
                            MeetingParticipant parti = new MeetingParticipant();

                            // get user id
                            var userid = Profile.getUserID(item["UserName"].ToString());
                            parti.UserID         = userid;
                            parti.Response       = MeetingReponse.Pending.ToString();
                            parti.Role           = item["Role"].ToString();
                            parti.Note           = item["Note"].ToString();
                            parti.InvitationDate = DateTime.Now;
                            Parties.Add(userid);

                            meeting.MeetingParticipants.Add(parti);
                            box.SaveChanges();
                            // for each agenda add agenda privacy
                            // get agneda
                            var agenda = (from o in box.Agenda
                                          where o.MeetingID == meetingID
                                          select o.AgendaID).ToList();
                            foreach (var g in agenda)
                            {
                                AgendaPrivacy p = new AgendaPrivacy();
                                p.CanSee   = false;
                                p.AgendaID = g;
                                p.PartiID  = parti.MeetingParti;
                                box.AgendaPrivacies.AddObject(p);
                            }
                        }

                        box.SaveChanges();
                        return(Parties);
                    }
                    else
                    {
                        throw new Exception("Error Saving Participants of the meeting MeetingClass.Participants.SaveParticipants");
                    }
                }
            }
Example #11
0
 public static bool UpdateAppointment(Event ev)
 {
     using (boxEntities box = new boxEntities())
     {
         var result = (from o in box.Meetings
                       where o.MeetingID == ev.Id
                       select o).FirstOrDefault();
         if (result != null)
         {
             result.StartDate    = ev.Start;
             result.EndDate      = ev.End;
             result.MeetingTitle = ev.Title;
             result.AllDay       = ev.Allday;
             result.MeetingDesc  = ev.Desc;
             // get invited and
             var part = (from i in box.MeetingParticipants
                         where i.MeetingID == ev.Id && i.Role == MeetingRoles.Attendee.ToString()
                         select i).FirstOrDefault();
             if (part != null)
             {
                 if (part.UserProfile.UserName != ev.Invited)
                 {
                     box.MeetingParticipants.DeleteObject(part);
                     int inv = Profile.getUserID(ev.Invited);
                     MeetingParticipant invited = new MeetingParticipant();
                     invited.UserID    = inv;
                     invited.Role      = MeetingRoles.Attendee.ToString();
                     invited.MeetingID = ev.Id;
                     invited.Response  = MeetingReponse.Pending.ToString();
                     result.MeetingParticipants.Add(invited);
                 }
             }
             box.SaveChanges();
             return(true);
         }
         else
         {
             return(false);
         }
     }
 }
Example #12
0
            internal static bool InsertCalender(DateTime sdate, DateTime edate, DateTime stime, DateTime etime, string title, string username, bool allday)
            {
                try
                {
                    using (boxEntities box = new boxEntities())
                    {
                        int userid = Profile.getUserID(username);

                        Meeting meet = new Meeting();
                        meet.StartDate    = new DateTime(sdate.Year, sdate.Month, sdate.Day, stime.Hour, stime.Minute, stime.Second);
                        meet.EndDate      = new DateTime(edate.Year, edate.Month, edate.Day, etime.Hour, etime.Minute, etime.Second);
                        meet.MeetingTitle = title;
                        meet.Cal          = true;
                        meet.Mee          = false;
                        meet.App          = false;
                        meet.AllDay       = allday;
                        // additional
                        meet.MeetingDesc = "";
                        meet.Type        = 0;

                        // add participant as creator
                        MeetingParticipant part = new MeetingParticipant();
                        part.UserID    = userid;
                        part.Role      = MeetingRoles.Creator.ToString();
                        part.MeetingID = meet.MeetingID;
                        part.Response  = MeetingReponse.Pending.ToString();
                        part.Note      = "";
                        meet.MeetingParticipants.Add(part);
                        box.Meetings.AddObject(meet);

                        box.SaveChanges();

                        return(true);
                    }
                }
                catch
                {
                    return(false);
                }
            }
Example #13
0
            internal static int InsertMeeting(DateTime sdate, DateTime edate, DateTime stime, DateTime etime, string title, string username, int type, string desc, bool allday)
            {
                try
                {
                    using (boxEntities box = new boxEntities())
                    {
                        int userid = Profile.getUserID(username);

                        Meeting meet = new Meeting();
                        meet.StartDate    = new DateTime(sdate.Year, sdate.Month, sdate.Day, stime.Hour, stime.Minute, stime.Second);
                        meet.EndDate      = new DateTime(edate.Year, edate.Month, edate.Day, etime.Hour, etime.Minute, etime.Second);
                        meet.MeetingTitle = title;
                        meet.Cal          = false;
                        meet.Mee          = true;
                        meet.App          = false;
                        meet.MeetingDesc  = desc;
                        meet.Type         = type;
                        meet.AllDay       = allday;

                        MeetingParticipant part1 = new MeetingParticipant();
                        part1.UserID    = userid;
                        part1.Role      = MeetingRoles.Creator.ToString();
                        part1.MeetingID = meet.MeetingID;
                        part1.Response  = MeetingReponse.Attending.ToString();
                        part1.Note      = "";
                        meet.MeetingParticipants.Add(part1);

                        // send invitations here
                        box.Meetings.AddObject(meet);

                        box.SaveChanges();
                        return(meet.MeetingID);
                    }
                }
                catch
                {
                    return(0);
                }
            }
Example #14
0
        private void AddToMeetingBtn_Click(object sender, RoutedEventArgs e)
        {
            var selected = AllUsersListBox.SelectedItem;

            if (selected != null)
            {
                var participant = new MeetingParticipant();

                foreach (var currentUser in UsersCollection.GetAllUsers())
                {
                    if (currentUser.UserName == selected.ToString())
                    {
                        participant.UserName           = currentUser.UserName;
                        participant.Slots              = currentUser.Slots;
                        participant.RelativeImportance = Importance.Normal;

                        CurrentMeeting.Participants.Add(participant);
                        AllUsersListBox.Items.Remove(selected);
                        RequestedUsersListBox.Items.Add(selected);
                        break;
                    }
                }
            }
        }
Example #15
0
        /**
         * this constructor does the following:
         * 1.  read in the X.509 certificate from the machine store
         * 2.  get the localhost IP address
         * 3.  create an executor / executor context for the local InfoAgent
         * 4.  create the DAO objects to access contents in the database
         * 5.  update the existing meetings with all meetings in the database
         * */
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            store = X509CertificateStore.LocalMachineStore(X509CertificateStore.MyStore);
            store.OpenRead();

            strMyId = "CN=Omar";
            certCol = store.FindCertificateBySubjectName(strMyId);

            cert      = (X509Certificate)certCol[0];
            certToken = new X509SecurityToken(cert);

            me      = new MeetingParticipant();
            me.Name = cert.GetName();
            me.Role = enuMeetingParticipantRole.Organizer;

            strFileLocation = "TotalRecall/InfoAgent.asmx?wsdl";
            string      strHost = Dns.GetHostName();
            IPHostEntry entry   = Dns.Resolve(strHost);
            string      strIP   = "";

            if (entry.AddressList.Length > 0)
            {
                IPAddress addr = new IPAddress(entry.AddressList[0].Address);
                strIP = addr.ToString();
            }
            else
            {
                m_boxInvite.Text = "ERROR getting host IP";
                return;
            }
            StringBuilder strbldUrl = new StringBuilder(strIP);

            strbldUrl.Append(strFileLocation);
            me.Location = strbldUrl.ToString();


            //create my infoagent
            strMyUrl = "http://localhost/TotalRecall/InfoAgent.asmx?wsdl";

            ProxyGenRequest pxyreq = new ProxyGenRequest();

            pxyreq.ProxyPath   = "";
            pxyreq.ServiceName = "InfoAgent";
            pxyreq.WsdlUrl     = strMyUrl;

            ProxyPolicyMutator mymutator = new ProxyPolicyMutator();

            mymutator.ProxyName = pxyreq.ServiceName;

            // Ensure the name of the file generated is unique
            string strMySuffix = "";
            int    nMyCode     = Guid.NewGuid().GetHashCode();

            if (nMyCode < 0)
            {
                nMyCode = nMyCode * -1;
            }
            strMySuffix        = nMyCode.ToString();
            pxyreq.ServiceName = pxyreq.ServiceName + "_" + strMySuffix;

            ProxyGen myPxyGen = new ProxyGen();

            myPxyGen.Mutator = mymutator;

            string strMyAssembly = "";

            try
            {
                strMyAssembly = myPxyGen.GenerateAssembly(pxyreq);
            }
            catch (Exception excep)
            {
                string strString = excep.Message;
            }

            myctx             = new ExecContext();
            myctx.ServiceName = pxyreq.Namespace + "." + mymutator.ProxyName;
            myctx.Assembly    = strMyAssembly;


            myexec = new Executor();
            myexec.Settings.ExpectSignedResponse = true;
            myexec.Settings.SigningCertificate   = cert;

            dbConnect = "DSN=TotalRecall;UID=TotalRecallUser;PWD=totalrecall;DATABASE=TotalRecall";

            mDAO = new MeetingDAO(dbConnect);
            pDAO = new ParticipantDAO(dbConnect);
            rDAO = new ResourceDAO(dbConnect);
            cDAO = new ContactDAO(dbConnect);

            strSelectedMtg = "";
            ArrayList lstMtgs = mDAO.GetMeetingIDs(enuMeetingState.Active);

            foreach (string s in lstMtgs)
            {
                m_boxMtgs.Items.Add(s);
            }
        }
Example #16
0
 public MeetingDetailApiModel()
 {
     participants = new MeetingParticipant();
 }
    public async Task <IEnumerable <Module> > GetAvailableModules(ClaimsPrincipal?principal, MeetingParticipant participant, Layout layout)
    {
        if (principal.IsAuthenticated())
        {
            using var dbContext = Factory.CreateDbContext();
            //var registeredModulesId = await dbContext.LayoutModules.AsNoTracking()
            //    .Where(lm => lm.LayoutId == layout.Id && lm.ParticipantId == participant.Id)
            //    .Select(lm => lm.ModuleId)
            //    .ToListAsync()
            //    .ConfigureAwait(false);

            var groupsId = await dbContext.GroupMembers.AsNoTracking()
                           .Where(gm => (gm.IsDataAdministrator || gm.IsGroupAdministrator || gm.MayBorrowModules) && gm.PersonId == participant.PersonId)
                           .Select(gm => gm.GroupId)
                           .ToListAsync()
                           .ConfigureAwait(false);

            var modules = await dbContext.Modules.AsNoTracking()
                          .Include(m => m.ModuleOwnerships)
                          .Include(m => m.Standard)
                          .Where(m => m.ScaleId == layout.PrimaryModuleStandard.ScaleId)
                          .ToListAsync()
                          .ConfigureAwait(false);

            ;
            if (modules is not null)
            {
                return(modules
                       .Where(m => m.ModuleOwnerships.Any(
                                  mo => mo.PersonId == participant.PersonId || groupsId.Any(id => id == mo.GroupId))));
            }
        }
        return(Array.Empty <Module>());
    }