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

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

                    </StackPanel>

                </StackPanel>

            </GroupBox>

 

        </WrapPanel>

        <Button Content="Сохранить"

               VerticalAlignment="Center"

               HorizontalAlignment="Center"

               Grid.Row="1"

               Click="savebutton_click"/>

    </Grid>

</UserControl>

EditContactView.xaml

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

            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"

            xmlns:validators="clr-namespace:SmsMessanger.Validators"

            mc:Ignorable="d"

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

    <UserControl.Resources>

        <validators:ErrorsToMessagesConverter x:Key="eToStringConverter" />

        <validators:ErrorsToVisibleConverter x:Key="eToVisiblityConverter" />       

    </UserControl.Resources>

   

    <DockPanel>

        <StackPanel Grid.Row="7"

                       Grid.Column="2"

                       DockPanel.Dock="Bottom">

            <Button x:Name="SaveButton"

               Click="saveButton_Click"

               Grid.Row="2"

               Width="32"

               Height="32"

               HorizontalAlignment="Left"

               Margin="4">

                <Button.Content>

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

                </Button.Content>

                <Button.ToolTip>

                    <TextBlock Text="Сохранить" />

                </Button.ToolTip>

            </Button>

        </StackPanel>

 

        <WrapPanel>

                <GroupBox Padding="10"

                         BorderThickness="2"

                         BorderBrush="{StaticResource ResourceKey=MediumBlue}">

                   

                    <GroupBox.Header>

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

                               Padding="5"

                               CornerRadius="5">

                            <TextBlock Text="Информация о студенте"

                                      Foreground="White"

                                      FontWeight="Bold"/>

                        </Border>

                    </GroupBox.Header>

                   

                    <Grid>

                        <Grid.ColumnDefinitions>

                        <ColumnDefinition Width="auto"/>

                        <ColumnDefinition Width="auto"/>

                    </Grid.ColumnDefinitions>

                        <Grid Width="100"

                             Height="100"

                             Grid.Column="0"

                             VerticalAlignment="Top">

                        <Border Background="LightGray"

                               Margin="5"

                               CornerRadius="5"/>

                        <Image x:Name="contactPhoto"

                              Source="{Binding Path=Contact.Photo}"

                              Margin="11"

                              Stretch="Fill"/>

                        <Button x:Name="choseImageButton"

                               Click="choseImageButton_click"

                               Background="Transparent"

                       Opacity=".1"></Button>

 

                    </Grid>

                        <StackPanel Orientation="Vertical"

                           DockPanel.Dock="Right"

                           Grid.Column="1"

                           VerticalAlignment="Top">

 

                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                            <Label Content="Имя:"

                         Target="{Binding ElementName=firstName}" />

                            <TextBox x:Name="firstName"

                           Style="{StaticResource ResourceKey=ContactEditorField}">

                                <TextBox.Text>

                                    <Binding Path="Contact.FirstName">

                                        <Binding.ValidationRules>

                                            <validators:TitlesValidator />

                                        </Binding.ValidationRules>

                                    </Binding>

                                </TextBox.Text>

                            </TextBox>

                        </StackPanel>

                        <!--Validation message-->

                        <TextBlock Text="{Binding ElementName=firstName, Path=(Validation.Errors), Converter={StaticResource eToStringConverter}}"

                                  Visibility="{Binding ElementName=firstName, Path=(Validation.Errors), Converter={StaticResource eToVisiblityConverter}}"

                                  Style="{StaticResource ValidationErrorMessage}"

                                  HorizontalAlignment="Center"/>

 

                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                            <Label Content="Фамилия:"

                          Target="{Binding ElementName=lastName}" />

                            <TextBox x:Name="lastName"

                            Style="{StaticResource ResourceKey=ContactEditorField}">

                                <TextBox.Text>

                                    <Binding Path="Contact.LastName">

                                        <Binding.ValidationRules>

                                            <validators:TitlesValidator />

                                        </Binding.ValidationRules>

                                    </Binding>

                                </TextBox.Text>

                            </TextBox>

                        </StackPanel>

                        <!--Validation message-->

                        <TextBlock Text="{Binding ElementName=lastName, Path=(Validation.Errors), Converter={StaticResource eToStringConverter}}"

                                  Visibility="{Binding ElementName=lastName, Path=(Validation.Errors), Converter={StaticResource eToVisiblityConverter}}"

                                  Style="{StaticResource ValidationErrorMessage}"

                                  HorizontalAlignment="Center"/>

 

                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                            <Label Content="Студенческий номер:"

                          Target="{Binding ElementName=number}" />

                            <TextBox x:Name="number"

                            Text="{Binding Path=Contact.Number}"

                            Style="{StaticResource ResourceKey=ContactEditorField}"/>

                        </StackPanel>

 

                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                            <Label Content="Сотовый телефон:"

                          Target="{Binding ElementName=cellPhone}" />

                            <TextBox x:Name="cellPhone"                            

                            Style="{StaticResource ResourceKey=ContactEditorField}">

                                <TextBox.Text>

                                    <Binding Path="Contact.CellPhone">

                                        <Binding.ValidationRules>

                                            <validators:CellPhoneValidation />

                                        </Binding.ValidationRules>

                                    </Binding>

                                </TextBox.Text>

                            </TextBox>                           

                        </StackPanel>

                        <!--Validation message-->

                        <TextBlock Text="{Binding ElementName=cellPhone, Path=(Validation.Errors), Converter={StaticResource eToStringConverter}}"

                                  Visibility="{Binding ElementName=cellPhone, Path=(Validation.Errors), Converter={StaticResource eToVisiblityConverter}}"

                                  Style="{StaticResource ValidationErrorMessage}"

                                  HorizontalAlignment="Center"/>

 

                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                            <Label Content="Домашний телефон:"

                          Target="{Binding ElementName=homePhone}" />

                            <TextBox x:Name="homePhone"

                            Text="{Binding Path=Contact.HomePhone}"

                            Style="{StaticResource ResourceKey=ContactEditorField}"/>

                        </StackPanel>

 

                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                            <Label Content="Адрес:"

                          Target="{Binding ElementName=address}" />

                            <TextBox x:Name="address"

                            Text="{Binding Path=Contact.Address}"

                            Style="{StaticResource ResourceKey=ContactEditorField}"/>

                        </StackPanel>

 

                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                            <Label Content="День рождения:"

                          Target="{Binding ElementName=birthDay}" />

                            <DatePicker x:Name="birthDay" SelectedDate="{Binding Path=Contact.BirthDay}"

                                       Style="{StaticResource ResourceKey=ContactEditorField}"/>

                        </StackPanel>

 

                        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">

                            <Label Content="Группа:"

                          Target="{Binding ElementName=address}" />

                            <ComboBox x:Name="groupList"

                                     ItemsSource="{Binding Path=AvalableGroups}"

                                     Style="{StaticResource ResourceKey=ContactEditorField}"

                                     SelectedItem="{Binding Path=Contact.Group}"/>

                        </StackPanel>

 

 

 

                    </StackPanel>

                    </Grid>

                </GroupBox>

 

 

        </WrapPanel>

 

    </DockPanel>

</UserControl>

 

 

EditDistributionListView.xaml

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

            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="500">

    <UserControl.Resources>

 

        <DataTemplate x:Key="TreeLevel2">

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

                <Grid DockPanel.Dock="Top" Width="200">

                    <Grid.ColumnDefinitions>

                        <ColumnDefinition Width="40" />

                        <ColumnDefinition Width="*" />

                        <ColumnDefinition Width="40" />

                    </Grid.ColumnDefinitions>

                    <Image Source="{Binding Path=Photo}" Width="24" Height="24" Stretch="Uniform" Margin="3 0 8 0" HorizontalAlignment="Left" />

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

              FontWeight="Bold"

              Foreground="White"

                                  Grid.Column="1"

                                  VerticalAlignment="Center"

                                  HorizontalAlignment="Left"/>

                    <CheckBox Grid.Column="2"

                            IsChecked="{Binding Path=IsChecked}"

                             Checked="ContactChecked"

                             Unchecked="ContactUnchecked"/>

                </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"

                             Unchecked="GroupUnchecked"/>

                    <Button Click="checkAllElementsButton_click"

                           Style="{DynamicResource TransparentButton}"

                           Width="24" Height="24">

                        <Button.Content>

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

                        </Button.Content>

                    </Button>

                </StackPanel>

            </Border>

        </HierarchicalDataTemplate>

 

    </UserControl.Resources>

    <Grid>

        <Grid.RowDefinitions>

            <RowDefinition Height="32" />

            <RowDefinition Height="auto" />

            <RowDefinition Height="*" />

            <RowDefinition Height="40" />

        </Grid.RowDefinitions>

 

        <Border CornerRadius="0 0 32 32"

               Background="{StaticResource MediumBlue}">

            <Viewbox MaxWidth="250">

                <TextBlock Text="Редактирование списка рассылки"

                      Foreground="White"

                      FontWeight="Bold"

                      FontFamily="Arial"

                      FontSize="18"

                      VerticalAlignment="Center"

                      HorizontalAlignment="Center"/>

            </Viewbox>

        </Border>

 

        <TreeView x:Name="tree"

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