Exemplo n.º 1
0
        public static void AddNotice(int StaffID, int StudentID, string Title, int AnnouncementID, bool IsNotification, bool IsViewed)
        {
            var statusMessage = String.Empty;

            try
            {
                var account = CloudStorageAccount.FromConfigurationSetting("TableDataConnectionString");

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

                context.AddMessage(StaffID, StudentID, Title, AnnouncementID, IsNotification, IsViewed);
            }
            catch (DataServiceRequestException ex)
            {
                statusMessage = "Unable to connect to the table storage server. Please check that the service is running.<br>"
                                + ex.Message;
            }
        }