Разработка системы рассылки СМС сообщений

Автор работы: Пользователь скрыл имя, 29 Января 2013 в 17:29, курсовая работа

Краткое описание

Целью курсовой работы является автоматизация рассылки SMS сообщений, для ускорения и облегчения работы по оповещению студентов.
Задачей, для достижения данной цели является создание приложения SmsMessenger, которое будет производить автоматизацию рассылки SMS.

Содержание

Введение 2
1. Описание предметной области 3
1.1. Предметная область курсового проекта 3
1.2. Информационно-логическая модель предметной области 3
2. Создание приложения SmsMessenger 6
2.1. Логическое проектирование 6
2.2. Модель данных 7
2.3. Описание представлений и представителей 8
3. Тестирование программы 17
Заключение 25
Список литературы 26
Пиложение А. Задание на курсовой проект 27
Приложение Б. Структура исходных файлов 28
Приложение В. XAML код всех представлений и библиотек ресурсов 30
Приложение Г. Код классов программы. 62

Вложенные файлы: 1 файл

Kursovik.docx

— 6.63 Мб (Скачать файл)

              Foreground="White"

                                  Grid.Column="1"

                                  VerticalAlignment="Center"

                              HorizontalAlignment="Left"/>

                    <CheckBox Grid.Column="2"

                            IsChecked="{Binding Path=IsChecked}"

                             />

                </Grid>

            </Border>

        </DataTemplate>

 

        <HierarchicalDataTemplate x:Key="TreeLevel1"

  ItemsSource="{Binding Path=Contacts}"

  ItemTemplate="{StaticResource TreeLevel2}">

            <Border CornerRadius="5" Background="#FF2F71A9" Margin="0,2" Padding="5 2 5 2">

                <StackPanel Orientation="Horizontal">

                    <TextBlock Text="{Binding Path=Title}" Foreground="White"></TextBlock>

                    <CheckBox IsChecked="{Binding Path=IsChecked}"

                             Margin="5 1 0 0"

                             />

                    <Button

                           Style="{DynamicResource TransparentButton}"

                           Width="24" Height="24">

                        <Button.Content>

                            <Image Source="/Images/SelectAll32.png" />

                        </Button.Content>

                    </Button>

                </StackPanel>

            </Border>

        </HierarchicalDataTemplate>

 

        <DataTemplate x:Key="SmsLevel">

            <Border CornerRadius="5" Background="#94a8ce" Margin="0,2" Padding="5" DockPanel.Dock="Top" Width="Auto">

                <Grid DockPanel.Dock="Top"

                     MaxWidth="200">

                    <Grid.ColumnDefinitions>

                        <ColumnDefinition Width="*" />

                        <ColumnDefinition Width="50"/>

                    </Grid.ColumnDefinitions>

                    <Grid.RowDefinitions>

                        <RowDefinition />

                        <RowDefinition />

                    </Grid.RowDefinitions>

                    <TextBlock Text="{Binding Path=Title}"

           DockPanel.Dock="Top"

           FontWeight="Bold"

           Foreground="White"

                               Grid.Column="0"

                               Grid.Row="0"/>

                    <TextBlock Text="{Binding Path=Text}"

                               DockPanel.Dock="Bottom"

                               TextWrapping="Wrap"

                               Height="auto"

                               MaxWidth="210"

                               Grid.Column="0"

                               Grid.Row="1"/>

                    <Button ToolTip="Редактировать"

                           Style="{DynamicResource TransparentButton}"

                           Grid.Row="0"

                           Grid.Column="1"

                           Grid.RowSpan="2"

                           Width="32"

                           Height="32"

                           Margin="2"

                           Click="PrepareSmsButton_click">

                        <Button.Content>

                            <Image Source="/Images/Paperclip32.png" Stretch="Uniform"/>

                        </Button.Content>

                    </Button>

                </Grid>

            </Border>

        </DataTemplate>

 

        <HierarchicalDataTemplate x:Key="SmsGroupsLevel"

  ItemsSource="{Binding Path=SmsTemplates}"

  ItemTemplate="{StaticResource SmsLevel}">

            <Border CornerRadius="5" Background="#FF2F71A9" Margin="0,2" Padding="5">

                <StackPanel Orientation="Horizontal">

                    <TextBlock Text="{Binding Path=Title}" Foreground="White"></TextBlock>

                </StackPanel>

            </Border>

        </HierarchicalDataTemplate>

 

    </UserControl.Resources>

    <Grid>

        <Grid.ColumnDefinitions>

            <ColumnDefinition Width="350" />

            <ColumnDefinition Width="350" />

            <ColumnDefinition Width="*" />

        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>

            <RowDefinition Height="*" />

            <RowDefinition Height="256" />

        </Grid.RowDefinitions>

       

        <GroupBox Padding="10"

                 BorderThickness="2"

                 BorderBrush="{StaticResource ResourceKey=MediumBlue}"

                 Margin="5">

 

            <GroupBox.Header>

                <Border Background="{StaticResource ResourceKey=MediumBlue}"

                               Padding="5"

                               CornerRadius="5">

                    <TextBlock Text="1: Список рассылки"

                                      Foreground="White"

                                      FontWeight="Bold"/>

                </Border>

            </GroupBox.Header>

            <TreeView x:Name="tree"

                 ItemsSource="{Binding Path=Model.Groups}" ItemTemplate="{DynamicResource TreeLevel1}" ItemContainerStyle="{DynamicResource SmsTreeViewStyle}"

                 BorderThickness="0"

                 DockPanel.Dock="Top">

                <TreeView.Resources>

                    <ResourceDictionary>

                        <ResourceDictionary.MergedDictionaries>

                            <ResourceDictionary Source="/Resources/SmsTreeTemplates.xaml"/>

                        </ResourceDictionary.MergedDictionaries>

                    </ResourceDictionary>

                </TreeView.Resources>

            </TreeView>

        </GroupBox>

 

        <GroupBox Padding="10"

                 BorderThickness="2"

                 BorderBrush="{StaticResource ResourceKey=MediumBlue}"

                 Margin="5"

                 Grid.Column="1">

            <GroupBox.Header>

                <Border Background="{StaticResource ResourceKey=MediumBlue}"

                               Padding="5"

                               CornerRadius="5">

                    <TextBlock Text="2: Выбор сообщения"

                                      Foreground="White"

                                      FontWeight="Bold"/>

                </Border>

            </GroupBox.Header>

           

                <ScrollViewer>

                    <TreeView ItemsSource="{Binding AvalableSmsTemplates}" ItemTemplate="{DynamicResource SmsGroupsLevel}" ItemContainerStyle="{DynamicResource SmsTreeViewStyle}"

                   BorderThickness="0">

                        <TreeView.Resources>

                            <ResourceDictionary>

                                <ResourceDictionary.MergedDictionaries>

                                    <ResourceDictionary Source="/Resources/SmsTreeTemplates.xaml"/>

                                </ResourceDictionary.MergedDictionaries>

                            </ResourceDictionary>

                        </TreeView.Resources>

                    </TreeView>

                </ScrollViewer>

        </GroupBox>

 

        <GroupBox Padding="10"

                 BorderThickness="2"

                 BorderBrush="{StaticResource ResourceKey=MediumBlue}"

                 Margin="5"

                 Grid.Column="0"

                 Grid.Row="1">

            <GroupBox.Header>

                <Border Background="{StaticResource ResourceKey=MediumBlue}"

                               Padding="5"

                               CornerRadius="5">

                    <TextBlock Text="3: Подготовка к отправке"

                                      Foreground="White"

                                      FontWeight="Bold"/>

                </Border>

            </GroupBox.Header>           

                <TextBox x:Name="SmsMessage"

                        MinLines="4"

                        TextWrapping="Wrap"

                        Text="{Binding Path=MessageText}"/>

        </GroupBox>

 

        <StackPanel Orientation="Vertical"

                   Grid.Row="1"

                   Grid.Column="1"

                   HorizontalAlignment="Center"

                   VerticalAlignment="Center">

            <GroupBox Visibility="Collapsed"

                     x:Name="templateGroupSelectorPanel"

                     Padding="5">

                <GroupBox.Header>

                    <TextBlock Text="Создание нового шаблона SMS"></TextBlock>

                </GroupBox.Header>

                <StackPanel>

                    <TextBlock Text="Название шаблона:" />

                    <TextBox x:Name="newTemplateTitle" Margin="5" />

                    <ComboBox x:Name="templateGroupSelector"

                             ItemsSource="{Binding Path=AvalableSmsTemplates}"

                             Margin="5">

                        <ComboBox.ItemTemplate>

                            <DataTemplate>

                                <TextBlock Text="{Binding Path=Title}" />

                            </DataTemplate>

                        </ComboBox.ItemTemplate>

                    </ComboBox>

                    <TextBlock Text="Введите название шаблона и выберите группу в которую хотите сохранить шаблон и затем повторно нажмите кнопку сохранение шаблона"

                              TextWrapping="Wrap"

                              MaxWidth="300"

                              Foreground="Gray"/>

                </StackPanel>

            </GroupBox>

 

            <StackPanel Orientation="Horizontal"

                       HorizontalAlignment="Center"

                       VerticalAlignment="Center"

                       Margin="10">

                <Button DockPanel.Dock="Bottom"

                       Click="SendSMS_button"

                       Width="64"

                       Height="64"

                       Margin="5">

                    <Button.Content>

                        <Image Source="/Images/mail-send.png" />

                    </Button.Content>

                    <Button.ToolTip>

                        <TextBlock>Отправить сообщение</TextBlock>

                    </Button.ToolTip>

                </Button>

                <Button DockPanel.Dock="Bottom"

                       Click="saveTemplateButton_click"

                       Width="64"

                       Height="64"

                       Margin="5">

                    <Button.Content>

                        <Image Source="/Images/document-save.png" />

                    </Button.Content>

                    <Button.ToolTip>

                        <TextBlock>Созранить сообщение как новый шаблон</TextBlock>

                    </Button.ToolTip>

                </Button>

                <Button DockPanel.Dock="Bottom"

                       Click="cancelButton_click"

                       Width="64"

                       Height="64"

                       Margin="5">

                    <Button.Content>

                        <Image Source="/Images/cancel.png" />

                    </Button.Content>

                    <Button.ToolTip>

                        <TextBlock>Отменить отправку</TextBlock>

                    </Button.ToolTip>

                </Button>

            </StackPanel>

        </StackPanel>

 

 

    </Grid>

</UserControl>

 

 

 

SmsSendReportView.xaml

<UserControl x:Class="SmsMessanger.Views.SmsSendReportView"

            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

            xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

            xmlns:d="http://schemas.microsoft.com/expression/blend/2008"

            mc:Ignorable="d"

            d:DesignHeight="300" d:DesignWidth="300">

    <UserControl.Resources>

        <DataTemplate x:Key="StudentTemplate">

            <Border Margin="3"

                   Padding="5">

                <Grid>

                    <Grid.ColumnDefinitions>

                        <ColumnDefinition Width="32" />

                        <ColumnDefinition Width="150" />

                        <ColumnDefinition Width="*" />

                    </Grid.ColumnDefinitions>

                    <Image Grid.Column="0"

                                              Source="{Binding Path=Photo}"

                                              Stretch="Uniform"

                                              DockPanel.Dock="Left"

                                              Width="32"

                                              Height="32"/>

                    <StackPanel Grid.Column="1">

                        <TextBlock Text="{Binding Path=Fio}"

                                                      Margin="5 0 0 0"

                                                      FontWeight="Bold"/>

                        <TextBlock Text="{Binding Path=Group.Title, StringFormat=Группа: \{0\}}"

                                                      Margin="5 0 0 0"/>

                        <TextBlock Text="{Binding Path=CellPhone, StringFormat=Сотовый: \{0\}}"

                                                      Margin="5 0 0 0"/>

                    </StackPanel>

                </Grid>

            </Border>

        </DataTemplate>

    </UserControl.Resources>

   

    <Grid>

        <Grid.RowDefinitions>

            <RowDefinition Height="*"/>

            <RowDefinition Height="*"/>

        </Grid.RowDefinitions>

        <GroupBox Padding="10"

                 BorderThickness="2"

                 BorderBrush="{StaticResource ResourceKey=MediumBlue}"

                 Margin="5">

 

            <GroupBox.Header>

                <Border Background="{StaticResource ResourceKey=MediumBlue}"

                               Padding="5"

Информация о работе Разработка системы рассылки СМС сообщений