public List <StaffMessage> getStaffRelatingMessages(int StaffID)
        {
            var account = CloudStorageAccount.FromConfigurationSetting("TableDataConnectionString");

            var context = new StaffMessageDataServiceContext(account.TableEndpoint.ToString(), account.Credentials);

            var StaffMessages = from m in context.StaffMessages
                                where m.StaffID == StaffID
                                select m;

            try
            {
                return(StaffMessages.ToList <StaffMessage>());
            }
            catch (Exception) { return(null); }
        }
        public static void AddStudentRequest(int StudentID, int StaffID, bool IsViewed)
        {
            var statusMessage = String.Empty;
            try
            {
                var account = CloudStorageAccount.FromConfigurationSetting("TableDataConnectionString");

                var context = new StaffMessageDataServiceContext(account.TableEndpoint.ToString(), account.Credentials);

                string text = Classes.HogwartsDataAccess.GetStudentName(StudentID) + " has made a request to change his/her profile";
                context.AddStaffMessage(StudentID, StaffID, text, IsViewed);
            }
            catch (DataServiceRequestException ex)
            {
                statusMessage = "Unable to connect to the table storage server. Please check that the service is running.<br>"
                                 + ex.Message;
            }
        }
        public static void ChangeStaffViewedStatus(string key)
        {
            var statusMessage = String.Empty;
            try
            {
                var account = CloudStorageAccount.FromConfigurationSetting("TableDataConnectionString");

                var context = new StaffMessageDataServiceContext(account.TableEndpoint.ToString(), account.Credentials);

                var o = (from message in context.StaffMessages
                         where message.RowKey == key
                         select message).First();

                o.IsViewed = true;
                context.UpdateObject(o);
                context.SaveChanges();
            }
            catch (DataServiceRequestException ex)
            {
                statusMessage = "Unable to connect to the table storage server. Please check that the service is running.<br>"
                                 + ex.Message;
            }
        }
        public List<StaffMessage> getStaffRelatingMessages(int StaffID)
        {
            var account = CloudStorageAccount.FromConfigurationSetting("TableDataConnectionString");

            var context = new StaffMessageDataServiceContext(account.TableEndpoint.ToString(), account.Credentials);

            var StaffMessages = from m in context.StaffMessages
                                where m.StaffID == StaffID
                                select m;
            try
            {
                return StaffMessages.ToList<StaffMessage>();
            }
            catch (Exception) { return null; }
        }