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

Автор работы: Пользователь скрыл имя, 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 Мб (Скачать файл)

                        </Button.ToolTip>

                    </Button>

                    <Button HorizontalAlignment="Left"

                           Height="24"

                           Width="24"

                           Margin="5 2 2 2"

                           Style="{DynamicResource TransparentButton}"

                           Click="EditSmsTemplateGroupButton_click">

                        <Button.Content>

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

                        </Button.Content>

                        <Button.ToolTip>

                            <StackPanel Orientation="Horizontal">

                                <TextBlock Text="Редактировать шаблон" />

                                <TextBlock Text="{Binding Path=Title, StringFormat=\{0\}}" />

                            </StackPanel>

                        </Button.ToolTip>

                    </Button>

                    <Button HorizontalAlignment="Left"

                           Height="24"

                           Width="24"

                           Margin="5 2 2 2"

                           Style="{DynamicResource TransparentButton}"

                           Click="DeleteSmsTemplateGroupButton_click">

                        <Button.Content>

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

                        </Button.Content>

                        <Button.ToolTip>

                            <StackPanel Orientation="Horizontal">

                                <TextBlock Text="Удалить группу шаблонов" />

                                <TextBlock Text="{Binding Path=Title, StringFormat=\{0\}}" />

                            </StackPanel>

                        </Button.ToolTip>

                    </Button>

                </StackPanel>

            </Border>

        </HierarchicalDataTemplate>

 

    </UserControl.Resources>

   

    <Grid>

        <Grid.RowDefinitions>

            <RowDefinition Height="32"/>

            <RowDefinition Height="*"/>

            <RowDefinition Height="50"/>

        </Grid.RowDefinitions>

        <Border Grid.Row="0"

               Style="{StaticResource TabTopHeader}"

               Background="{StaticResource MediumBlue}">

            <TextBlock Text="Шаблоны SMS сообщений"

                      HorizontalAlignment="Center"

                      Foreground="White"

                      FontSize="14"

                      FontWeight="Bold"/>

        </Border>

 

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

                 BorderThickness="0"

                 Grid.Row="1">

            <TreeView.Resources>

                <ResourceDictionary>

                    <ResourceDictionary.MergedDictionaries>

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

                    </ResourceDictionary.MergedDictionaries>

                </ResourceDictionary>

            </TreeView.Resources>

        </TreeView>

 

        <Button Grid.Row="2"

               DockPanel.Dock="Bottom"

               Height="32" Width="32"

               HorizontalAlignment="Left"

               Click="AddTemplateGroupButton_click"

               Margin="5">

            <Button.Content>

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

            </Button.Content>

        </Button>

 

    </Grid>

   

</UserControl>

Ресурсы

Colors.xaml

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

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

    <SolidColorBrush x:Key="MediumBlue"

                    Color="#145e9d" />

</ResourceDictionary>

 

DefaultStyles.xaml

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

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

    <Style x:Key="ContactEditorField" TargetType="{x:Type Control}">

        <Setter Property="Width"

               Value="150" />

        <Setter Property="Margin"

               Value="5" />

    </Style>

    <Style x:Key="SideBarControlButton" TargetType="{x:Type Control}">

        <Setter Property="Width"

               Value="16" />

        <Setter Property="Height"

               Value="16" />

        <Setter Property="Margin"

               Value="2" />

    </Style>

 

    <Style x:Key="SmsControlButton" TargetType="{x:Type Control}">

        <Setter Property="Width"

               Value="16" />

        <Setter Property="Height"

               Value="16" />

        <Setter Property="Margin"

               Value="0 0 1 0" />

    </Style>

   

    <Style x:Key="TabTopHeader" TargetType="{x:Type Border}">

        <Setter Property="HorizontalAlignment"

               Value ="Stretch" />

        <Setter Property="Margin"

               Value ="0 0 0 5" />

        <Setter Property="CornerRadius"

               Value ="0 0 10 10" />

    </Style>

 

    <Style x:Key="ValidationErrorMessage" TargetType="{x:Type TextBlock}">

        <Setter Property="Foreground"

               Value ="Red" />

        <Setter Property="Margin"

               Value ="5" />

        <Setter Property="FontSize"

               Value ="10" />

    </Style>

</ResourceDictionary>

 

SmsTreeTemplates.xaml

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

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

   

   

   

    <Style x:Key="TreeViewItemFocusVisual">

        <Setter Property="Control.Template">

            <Setter.Value>

                <ControlTemplate>

                    <Rectangle/>

                </ControlTemplate>

            </Setter.Value>

        </Setter>

    </Style>

    <PathGeometry x:Key="TreeArrow" Figures="M0,0 L0,6 L6,0 z"/>

    <Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}">

        <Setter Property="Focusable" Value="False"/>

        <Setter Property="Width" Value="16"/>

        <Setter Property="Height" Value="16"/>

        <Setter Property="Template">

            <Setter.Value>

                <ControlTemplate TargetType="{x:Type ToggleButton}">

                    <Border x:Name="border" BorderBrush="#FF145E9D" BorderThickness="2" CornerRadius="3" Background="White">

                        <VisualStateManager.VisualStateGroups>

                            <VisualStateGroup x:Name="CommonStates">

                                <VisualState x:Name="Normal"/>

                                <VisualState x:Name="MouseOver">

                                    <Storyboard>

                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="border">

                                            <EasingColorKeyFrame KeyTime="0" Value="#FF145E9D"/>

                                        </ColorAnimationUsingKeyFrames>

                                        <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)" Storyboard.TargetName="textBlock">

                                            <EasingColorKeyFrame KeyTime="0" Value="White"/>

                                        </ColorAnimationUsingKeyFrames>

                                    </Storyboard>

                                </VisualState>

                                <VisualState x:Name="Pressed"/>

                                <VisualState x:Name="Disabled"/>

                            </VisualStateGroup>

                            <VisualStateGroup x:Name="FocusStates">

                                <VisualState x:Name="Unfocused"/>

                                <VisualState x:Name="Focused"/>

                            </VisualStateGroup>

                            <VisualStateGroup x:Name="CheckStates">

                                <VisualState x:Name="Checked">

                                    <Storyboard>

                                        <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.Text)" Storyboard.TargetName="textBlock">

                                            <DiscreteStringKeyFrame KeyTime="0" Value="-"/>

                                        </StringAnimationUsingKeyFrames>

                                    </Storyboard>

                                </VisualState>

                                <VisualState x:Name="Unchecked"/>

                                <VisualState x:Name="Indeterminate"/>

                            </VisualStateGroup>

                            <VisualStateGroup x:Name="ValidationStates">

                                <VisualState x:Name="Valid"/>

                                <VisualState x:Name="InvalidFocused"/>

                                <VisualState x:Name="InvalidUnfocused"/>

                            </VisualStateGroup>

                        </VisualStateManager.VisualStateGroups>

                        <TextBlock x:Name="textBlock" Text="+" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" FontWeight="Bold" FontFamily="Arial Rounded MT Bold" Foreground="#FF4D4D4D"/>

                    </Border>

                    <ControlTemplate.Triggers>

                        <Trigger Property="IsMouseOver" Value="True"/>

                        <Trigger Property="IsChecked" Value="True"/>

                    </ControlTemplate.Triggers>

                </ControlTemplate>

            </Setter.Value>

        </Setter>

    </Style>

    <Style x:Key="SmsTreeViewStyle" TargetType="{x:Type TreeViewItem}">

        <Setter Property="BorderThickness" Value="0" />

        <Setter Property="Margin" Value="5" />

        <Setter Property="Background" Value="Transparent"/>

        <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>

        <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>

        <Setter Property="Padding" Value="1,0,0,0"/>

        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>

        <Setter Property="FocusVisualStyle" Value="{StaticResource TreeViewItemFocusVisual}"/>

        <Setter Property="Template">

            <Setter.Value>

                <ControlTemplate TargetType="{x:Type TreeViewItem}">

                    <Grid>

                        <Grid.ColumnDefinitions>

                            <ColumnDefinition MinWidth="19" Width="Auto"/>

                            <ColumnDefinition Width="Auto"/>

                            <ColumnDefinition Width="*"/>

                        </Grid.ColumnDefinitions>

                        <Grid.RowDefinitions>

                            <RowDefinition Height="Auto"/>

                            <RowDefinition/>

                        </Grid.RowDefinitions>

                        <ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>

                        <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Column="1" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">

                            <ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>

                        </Border>

                        <ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1"/>

                    </Grid>

                    <ControlTemplate.Triggers>

                        <Trigger Property="IsExpanded" Value="false">

                            <Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>

                        </Trigger>

                        <Trigger Property="HasItems" Value="false">

                            <Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>

                        </Trigger>

                        <Trigger Property="IsSelected" Value="true">

                            <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"/>

                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/>

                        </Trigger>

                        <MultiTrigger>

                            <MultiTrigger.Conditions>

                                <Condition Property="IsSelected" Value="true"/>

                                <Condition Property="IsSelectionActive" Value="false"/>

                            </MultiTrigger.Conditions>

                            <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>

                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>

                        </MultiTrigger>

                        <Trigger Property="IsEnabled" Value="false">

                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>

                        </Trigger>

                    </ControlTemplate.Triggers>

                </ControlTemplate>

            </Setter.Value>

        </Setter>

        <Style.Triggers>

            <Trigger Property="VirtualizingStackPanel.IsVirtualizing" Value="true">

                <Setter Property="ItemsPanel">

                    <Setter.Value>

                        <ItemsPanelTemplate>

                            <VirtualizingStackPanel/>

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