Постановка задачи на ЭИС

Автор работы: Пользователь скрыл имя, 12 Января 2013 в 15:16, дипломная работа

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

Целью данной работы является создание системы, которая обеспечит решение следующих задач:
вести журнал посещения и хранения автомобилей на стоянках;
отслеживать информацию о клиентах компании;
отслеживать свободное пространство на стоянках и рекомендовать постановку машины;
вести договора с клиентами.

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

3931 Диплом_9.doc

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

        ' AppDatabase1DataSet1.users.Select("username='" + user + "'")

 

 

 

        prava = autorization.GetPermition(ToolStripLabel1.Text)

 

        'MsgBox(prava)

        If prava = "1" Then

            АдминистрированиеToolStripMenuItem.Enabled = True

        Else

            АдминистрированиеToolStripMenuItem.Enabled = False

 

        End If

        Timer1.Enabled = True

 

        Dim ctrl As System.Windows.Forms.Control

        Dim component As System.ComponentModel.IComponent

        component = My.Forms.help.WebBrowser1

        ctrl = Me

 

        HelpProvider1.SetShowHelp(ctrl, True)

 

    End Sub

 

 

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

 

        Dim prava As Integer

 

 

 

        ' AppDatabase1DataSet1.users.Select("username='" + user + "'")

 

 

 

        prava = autorization.GetPermition(ToolStripLabel1.Text)

 

        'MsgBox(prava)

        If prava = "1" Then

            АдминистрированиеToolStripMenuItem.Enabled = True

            АбонементToolStripMenuItem.Enabled = True

            ОплатаПарковкиToolStripMenuItem.Enabled = True

            Timer1.Enabled = False

 

        Else

            АдминистрированиеToolStripMenuItem.Enabled = False

            АбонементToolStripMenuItem.Enabled = False

            ОплатаПарковкиToolStripMenuItem.Enabled = False

        End If

    End Sub

 

    Private Sub ЗапарковатьАвтоToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ЗапарковатьАвтоToolStripMenuItem.Click

        My.Forms.Form3.Show()

        My.Forms.Form3.TextBox4.Text = ToolStripLabel1.Text

        My.Forms.Form3.Text = My.Forms.Form3.Text + Chr(160) + " Пользователь (" + ToolStripLabel1.Text + ")"

 

    End Sub

 

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick

        'TODO: Данная строка кода позволяет загрузить данные в таблицу "AppDatabase1DataSet1.cars". При необходимости она может быть перемещена или удалена.

        Me.CarsTableAdapter.Fill(Me.AppDatabase1DataSet1.cars)

        Timer2.Enabled = False

 

    End Sub

 

    Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click

        My.Forms.LoginForm1.Show()

        My.Forms.Form3.Close()

        My.Forms.SplashScreen1.Close()

        My.Forms.abonement.Close()

        My.Forms.abonementi.Close()

        My.Forms.dolzhneti.Close()

        My.Forms.Form2.Close()

        My.Forms.Form4.Close()

        My.Forms.Form5.Close()

 

        My.Forms.Form6.Close()

        My.Forms.oplata_dog.Close()

        My.Forms.parc_mans.Close()

        My.Forms.pay.Close()

        My.Forms.pay_night.Close()

        My.Forms.proch_rash.Close()

        My.Forms.Vedomost.Close()

        My.Forms.zarplata.Close()

        My.Forms.AboutBox1.Close()

 

        Me.Close()

 

    End Sub

 

    Private Sub CarsDataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles CarsDataGridView.CellContentClick

        Try

 

 

            Dim form As Windows.Forms.Form = My.Forms.Form4

 

 

            Dim row As DataRow

            Dim prava As Integer = autorization.GetPermition(ToolStripLabel1.Text)

 

            Dim inf As Boolean = False

 

 

            Dim sch As Integer = 0

 

 

            row = GetCurrentRow(Me.CarsDataGridView)

       

 

            Dim object2 As DataRow

            For Each object2 In AppDatabase1DataSet1.cars.Select("number ='" + row.ItemArray(2) + "'")

 

 

 

                My.Forms.Form4.MaskedTextBox2.Text = object2.ItemArray.GetValue(3)

 

 

           Next

 

            If row.ItemArray(6) <> Nothing Then

                If prava = 1 Then

                    inf = False

                Else

                    inf = True

                End If

 

 

 

            Else

                inf = False

 

           End If

 

 

            If inf = False Then

 

 

                My.Forms.Form4.TextBox1.Text = row.ItemArray(1)

 

                My.Forms.Form4.TextBox2.Text = row.ItemArray(2)

                My.Forms.Form4.TextBox3.Text = row.ItemArray(5)

                My.Forms.Form4.TextBox4.Text = ToolStripLabel1.Text

                If row.ItemArray(6) <> Nothing Then

                    My.Forms.Form4.TextBox5.Text = row.ItemArray(6)

                End If

                My.Forms.Form4.MaskedTextBox1.Text = System.DateTime.Now

                My.Forms.Form4.Text = My.Forms.Form4.Text + Chr(160) + " Пользователь (" + ToolStripLabel1.Text + ")"

                form.Show()

            Else

                MsgBox("Вам запрещено Редактирование Уже оплаченых услуг!!!")

 

            End If

 

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

 

    End Sub

 

    Public Function GetCurrentRow(ByVal Grid As DataGridView) As DataRow

        Dim cm As CurrencyManager = CType(Grid.BindingContext(Grid.DataSource, Grid.DataMember), CurrencyManager)

        Dim drv As DataRowView = CType(cm.Current, DataRowView)

        Return drv.Row

 

    End Function

 

    Private Sub ОплатаПарковкиToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ОплатаПарковкиToolStripMenuItem.Click

        My.Forms.Form5.Show()

 

    End Sub

 

    Private Sub СпиToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles СпиToolStripMenuItem.Click

        My.Forms.abonementi.Show()

 

    End Sub

 

    Private Sub ФинансыToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ФинансыToolStripMenuItem.Click

        My.Forms.oplata_dog.Show()

 

    End Sub

 

    Private Sub ToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem1.Click

        My.Forms.Form2.Show()

    End Sub

 

    Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem2.Click

        My.Forms.parc_mans.Show()

 

    End Sub

 

    Private Sub ToolStripButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton2.Click

        My.Forms.AboutBox1.Show()

 

     

 

    End Sub

 

 

    Private Sub ToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem3.Click

        My.Forms.abonement.Show()

    End Sub

End Class


Листинг В.8 - Модуль Form2

Public Class Form2

 

    Private Sub UsersBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UsersBindingNavigatorSaveItem.Click

        Me.Validate()

        Me.UsersBindingSource.EndEdit()

        Me.UsersTableAdapter.Update(Me.AppDatabase1DataSet1.users)

 

    End Sub

 

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'TODO: Данная строка кода позволяет загрузить данные в таблицу "AppDatabase1DataSet1.users". При необходимости она может быть перемещена или удалена.

        Me.UsersTableAdapter.Fill(Me.AppDatabase1DataSet1.users)

 

    End Sub

End Class


Листинг В.9 - Модуль Form3

Public Class Form3

 

    Private Sub CarsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)

        Me.Validate()

        Me.CarsBindingSource.EndEdit()

        Me.CarsTableAdapter.Update(Me.AppDatabase1DataSet1.cars)

 

    End Sub

 

    Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'TODO: Данная строка кода позволяет загрузить данные в таблицу "AppDatabase1DataSet1.users". При необходимости она может быть перемещена или удалена.

        Me.UsersTableAdapter.Fill(Me.AppDatabase1DataSet1.users)

        'TODO: Данная строка кода позволяет загрузить данные в таблицу "AppDatabase1DataSet1.cars". При необходимости она может быть перемещена или удалена.

        Me.CarsTableAdapter.Fill(Me.AppDatabase1DataSet1.cars)

        'TODO: Данная строка кода позволяет загрузить данные в таблицу "AppDatabase1DataSet1.users". При необходимости она может быть перемещена или удалена.

        Me.UsersTableAdapter.Fill(Me.AppDatabase1DataSet1.users)

        'TODO: Данная строка кода позволяет загрузить данные в таблицу "AppDatabase1DataSet1.cars". При необходимости она может быть перемещена или удалена.

        Me.CarsTableAdapter.Fill(Me.AppDatabase1DataSet1.cars)

 

        MaskedTextBox1.Text = Date.Now.Date.ToShortDateString.Format("DD-mm-YY")

 

 

 

 

 

    End Sub

 

    Private Sub CarsBindingNavigatorSaveItem_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs)

        Me.Validate()

        Me.CarsBindingSource.EndEdit()

        Me.CarsTableAdapter.Update(Me.AppDatabase1DataSet1.cars)

 

 

    End Sub

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Me.Close()

 

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        If TextBox2.Text <> Nothing And TextBox1.Text <> Nothing And MaskedTextBox1.Text <> Nothing And TextBox3.Text <> Nothing Then

            ProgressBar1.Visible = True

            ProgressBar1.Value = 10

 

            Dim car As String = TextBox2.Text

 

            Dim number As String = TextBox1.Text

            Dim data_in As String = MaskedTextBox1.Text

            'data_in = data_in.Replace("-", "/")

            'data_in = Convert.ToDateTime(data_in).ToShortDateString

 

 

 

            Dim paym As String = TextBox3.Text

            Dim park_man_in As String = TextBox4.Text

            ProgressBar1.Value = 35

            Try

 

           

                My.Forms.Form1.CarsTableAdapter.InsertQuery(car, number, data_in, "", paym, "", park_man_in, "")

 

            Catch ex As Exception

                MsgBox(ex.Message)

            End Try

 

            ProgressBar1.Value = 70

 

            My.Forms.Form1.CarsTableAdapter.Fill(Me.AppDatabase1DataSet1.cars)

            ProgressBar1.Value = 90

            My.Forms.Form1.Timer2.Enabled = True

            ProgressBar1.Value = 100

            ProgressBar1.Visible = False

            ProgressBar1.SelectNextControl(Me.Button1, True, True, False, False)

            Me.Button1.Focus()

 

 

 

 

 

 

        Else

            Label5.Text = "Внимание Внесите всю информацию об Автомобиле!!!"

        End If

    End Sub

End Class


Листинг В.10 - Модуль Form4

Public Class Form4

 

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Me.Close()

 

    End Sub

 

 

    Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'TODO: Данная строка кода позволяет загрузить данные в таблицу "AppDatabase1DataSet1.tarifs". При необходимости она может быть перемещена или удалена.

        Me.TarifsTableAdapter.Fill(Me.AppDatabase1DataSet1.tarifs)

        MaskedTextBox1.Text = System.DateTime.Now.Date

 

    End Sub

 

    Private Sub NameComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NameComboBox.SelectedIndexChanged

        Try

 

       

            Dim tarif As String = NameComboBox.Text

            Dim stoj As String

            Dim edizm As Integer

            Dim object1 As DataRow

            Dim date1 As String = MaskedTextBox2.Text

 

            For Each object1 In AppDatabase1DataSet1.tarifs.Select("name='" + tarif + "'")

                stoj = object1.ItemArray.GetValue(3)

                edizm = object1.ItemArray.GetValue(2)

            Next

 

 

            date1 = Convert.ToDateTime(date1)

            Dim time_nach As Date = date1

 

 

            Dim data_out As Date = MaskedTextBox1.Text

            Dim interval As DateInterval = DateInterval.Day

 

            Dim returnValue As TimeSpan = data_out - time_nach

 

            Dim day1 As Integer = data_out.Day

            Dim day2 As Integer = time_nach.Day

            Dim data_delta As Integer = returnValue.Days

 

            TextBox5.Text = data_delta / edizm * stoj

        Catch ex As Exception

            MsgBox(ex.Message)

        End Try

 

 

    End Sub

 

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

        Dim number As String = TextBox2.Text

        Dim date_o As Date = Convert.ToDateTime(MaskedTextBox1.Text)

        Dim user As String = TextBox4.Text

        Dim tarif As String = NameComboBox.Text

        Dim money As String = TextBox5.Text

        Dim car As String

        Dim paym As String

        Dim data_in As String

        Dim park_man_in As String

        Dim row As DataRow

        Dim id As Integer

        Try

            For Each row In My.Forms.Form1.AppDatabase1DataSet1.cars.Select("number ='" + number + "'")

 

 

                id = row.ItemArray(0)

 

                car = row.ItemArray(1)

                number = row.ItemArray(2)

                data_in = row.ItemArray(3)

                paym = row.ItemArray(5)

                park_man_in = row.ItemArray(7)

            Next

        Catch ex As Exception

            MsgBox("Исключение произошло при выборе из таблици парковки автомобилей (" + ex.Message + ")")

        End Try

        Try

            My.Forms.Form1.CarsTableAdapter.Update(car, number, data_in, date_o, paym, money, park_man_in, user, id)

        Catch ex As Exception

            MsgBox("Исключение произошло при попытке обновить данные в таблице парковки автомобилей (" + ex.Message + ")")

        End Try

        My.Forms.Form1.CarsTableAdapter.Fill(Me.AppDatabase1DataSet1.cars)

        Me.Close()

 

    End Sub

End Class


Листинг В.11 - Модуль Form5

Public Class Form5

 

    Private Sub TarifsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TarifsBindingNavigatorSaveItem.Click

        Me.Validate()

        Me.TarifsBindingSource.EndEdit()

        Me.TarifsTableAdapter.Update(Me.AppDatabase1DataSet1.tarifs)

 

    End Sub

 

    Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        'TODO: Данная строка кода позволяет загрузить данные в таблицу "AppDatabase1DataSet1.tarifs". При необходимости она может быть перемещена или удалена.

        Me.TarifsTableAdapter.Fill(Me.AppDatabase1DataSet1.tarifs)

 

    End Sub

End Class

 

Модуль Form6

 

Imports System.IO

Imports System.Drawing.Printing

 

Public Class Form6

    Private PrintPageSettings As New PageSettings

    Private StringToPrint As String

    Private PrintFont As New Font("Arial", 10)

    Private Sub Form6_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

 

        Dim var As Object

        For Each var In RichTextBox1.Lines

            RichTextBox1.Text = RichTextBox1.Text.Replace("number", My.Forms.abonement.TextBox9.Text)

            RichTextBox1.Text = RichTextBox1.Text.Replace("data_dog", My.Forms.abonement.DateTimePicker1.Text)

            RichTextBox1.Text = RichTextBox1.Text.Replace("data_dig", My.Forms.abonement.DateTimePicker2.Text)

            RichTextBox1.Text = RichTextBox1.Text.Replace("vladelec", My.Forms.abonement.TextBox1.Text + " " + My.Forms.abonement.TextBox2.Text + " " + My.Forms.abonement.TextBox3.Text)

            RichTextBox1.Text = RichTextBox1.Text.Replace("marka", My.Forms.abonement.TextBox6.Text + " ")

            RichTextBox1.Text = RichTextBox1.Text.Replace("gos_nom", My.Forms.abonement.MaskedTextBox6.Text + " ")

            RichTextBox1.Text = RichTextBox1.Text.Replace("yvip", My.Forms.abonement.MaskedTextBox7.Text + " ")

            RichTextBox1.Text = RichTextBox1.Text.Replace("stoj", My.Forms.abonement.TextBox10.Text + " ")

 

            RichTextBox1.Text = RichTextBox1.Text.Replace("pasport", My.Forms.abonement.MaskedTextBox3.Text + "/" + My.Forms.abonement.MaskedTextBox4.Text + "Выдан: " + My.Forms.abonement.TextBox5.Text + Chr(10) + Chr(13) + My.Forms.abonement.MaskedTextBox5.Text)

Информация о работе Постановка задачи на ЭИС