Esempio n. 1
0
        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;
            }
        }