Рефераты. Автошкола "Кадиллак"

Sheets("База").Cells(all + 1, 23) = "Нет"

Sheets("База").Cells(all + 1, 24) = "Нет"

Sheets("База").Cells(all + 1, 25) = "Нет"

Sheets("База").Cells(all + 1, 26) = "Нет"

Sheets("База").Cells(all + 1, 27) = "Нет"

Sheets("База").Cells(all + 1, 28) = "Нет"

Sheets("База").Cells(all + 1, 29) = "Ожидает"

x = MsgBox("Клиент успешно занесен в базу данных", vbInformation + vbOKOnly, "Автошкола")

AddClientForm.Hide

ClientForm.Show (0)

Else

erin:

x = MsgBox("Проверьте правильность введеных значений", vbCritical + vbOKOnly, "Автошкола")

End If

End Sub

КнопкаЗакрыть”:

Private Sub bt_exit_Click()

AddClientForm.Hide

ClientForm.Show (0)

End Sub

СписокАвтомобиль”:

Private Sub cb_car_Change()

Sheets("Данные").Activate

cb_teacher.Clear

For i = 2 To 10

If Sheets("Данные").Cells(i, 4) = cb_car.Value Then cb_teacher.AddItem Sheets("Данные").Cells(i, 3)

Next i

cb_teacher.ListIndex = 0

End Sub

ПолеДом”:

Private Sub ed_home_Change()

ed_home.Text = Val(ed_home.Text)

End Sub

ПолеСотовый”:

Private Sub ed_mobile_Change()

ed_mobile.Text = Val(ed_mobile.Text)

End Sub

ПолеНомер”:

Private Sub ed_num_Change()

ed_num.Text = Val(ed_num.Text)

End Sub

Поле “Дом. телефон”:

Private Sub ed_phone_Change()

ed_phone.Text = Val(ed_phone.Text)

End Sub

ПолеКвартира”:

Private Sub ed_room_Change()

ed_room.Text = Val(ed_room.Text)

End Sub

ПолеСерия”:

Private Sub ed_ser_Change()

ed_ser.Text = Val(ed_ser.Text)

End Sub

Активация формы:

Private Sub UserForm_Activate()

ed_surname.Text = ""

ed_name.Text = ""

ed_patron.Text = ""

ed_birth.Text = ""

ed_who.Text = ""

ed_date.Text = ""

ed_ser.Text = ""

ed_num.Text = ""

ed_str.Text = ""

ed_home.Text = ""

ed_room.Text = ""

ed_phone.Text = ""

ed_mobile.Text = ""

End Sub

Инициализация формы:

Private Sub UserForm_Initialize()

Sheets("Данные").Activate

cb_car.ListIndex = 0

cb_teacher.Clear

cb_teacher.AddItem Cells(4, 3)

cb_teacher.ListIndex = 0

End Sub

Завершение работы формы:

Private Sub UserForm_Terminate()

AddClientForm.Hide

ClientForm.Show (0)

End Sub

5.7 Форма “Формирование бланка оплаты”

КнопкаЗакрыть”:

Private Sub bt_exit_Click()

PayForm.Hide

ClientForm.Show (0)

End Sub

КнопкаСформировать бланк”:

Private Sub bt_makeblank_Click()

If (ed_datepay.Text = CDate(ed_datepay.Text)) And cb_whopay.Text <> "" And ed_money.Value <> "" And ed_money.Value <> 0 Then

Sheets("Оплата").Activate

Sheets("Оплата").Range("B5").Value = cb_whopay.Value

Sheets("Оплата").Range("C8").Value = ed_datepay.Text

Sheets("Оплата").Range("C9").Value = ed_money.Text & " руб."

PayForm.Hide

Sheets("Оплата").Visible = True

Else

x = MsgBox("Проверьте правильность введеных значений", vbCritical + vbOKOnly, "Автошкола")

End If

End Sub

Кнопка “Подтвердить оплату”:

Private Sub bt_pay_Click()

If (ed_datepay.Text = CDate(ed_datepay.Text)) And cb_whopay.Text <> "" And ed_money.Value <> "" And ed_money.Value <> 0 Then

Sheets("База").Activate

Sheets("База").Cells(1, 1).Select

all = Selection.CurrentRegion.Rows.Count

For i = 2 To all

If Sheets("База").Cells(i, 29) <> "Окончил" And (Sheets("База").Cells(i, 2) & " " & Sheets("База").Cells(i, 3) & " " & Sheets("База").Cells(i, 4)) = cb_whopay.Text Then Cells(i, 21) = Val(Cells(i, 21)) + ed_money.Value

Next i

y = MsgBox("Оплата внесена!", vbInformation + vbOKOnly, "Автошкола")

Else

x = MsgBox("Проверьте правильность введеных значений", vbCritical + vbOKOnly, "Автошкола")

End If

End Sub

ПолеСумма платежа (руб.)”:

Private Sub ed_money_Change()

ed_money.Value = Val(ed_money.Value)

End Sub

Активация формы:

Private Sub UserForm_Activate()

cb_whopay.Clear

ed_money.Value = ""

Dim x As Integer

x = 0

ed_datepay.Text = Date

Sheets("База").Activate

Sheets("База").Cells(1, 1).Select

all = Selection.CurrentRegion.Rows.Count

For i = 2 To all

If Sheets("База").Cells(i, 29) <> "Окончил" Then

cb_whopay.AddItem (Sheets("База").Cells(i, 2) & " " & Sheets("База").Cells(i, 3) & " " & Sheets("База").Cells(i, 4))

x = x + 1

End If

Next i

If x = 0 Then

y = MsgBox("Текущая группа пуста!", vbCritical + vbOKOnly, "Автошкола")

PayForm.Hide

ClientForm.Show (0)

Else

cb_whopay.ListIndex = 0

End If

End Sub

Завершение работы формы:

Private Sub UserForm_Terminate()

PayForm.Hide

ClientForm.Show (0)

End Sub

5.8 ФормаДопуски

Процедура (обновление активности):

Sub endis()

level_1.Enabled = True

level_2.Enabled = True

level_3.Enabled = True

If cb_able.Value = True And cb_pdd.Value = True And cb_help.Value = True And Val(desc_howmuchdrive.Text) >= Sheets("Данные").Range("L4") And Val(desc_howmuchpay.Caption) >= Sheets("Данные").Range("L2") Then

level_1.Enabled = False

If cb_insidepdd.Value = True And cb_insidedrive.Value = True And cb_insidegorod.Value = True Then

level_2.Enabled = False

Else

level_3.Enabled = False

End If

Else

level_2.Enabled = False

level_3.Enabled = False

End If

End Sub

КнопкаВыйти”:

Private Sub bt_exit_Click()

WayForm.Hide

ClientForm.Show (0)

End Sub

КнопкаСохранить”:

Private Sub bt_save_Click()

Sheets("База").Activate

Sheets("База").Cells(1, 1).Select

all = Selection.CurrentRegion.Rows.Count

For i = 2 To all

If ComboBox1.Text = (Sheets("База").Cells(i, 2) & " " & Sheets("База").Cells(i, 3) & " " & Sheets("База").Cells(i, 4)) And Sheets("База").Cells(i, 29) = "Обучаемый" Then

If cb_able.Value = True Then Sheets("База").Cells(i, 17) = "Да" Else Sheets("База").Cells(i, 17) = "Нет"

If cb_pdd.Value = True Then Sheets("База").Cells(i, 15) = "Да" Else Sheets("База").Cells(i, 15) = "Нет"

If cb_help.Value = True Then Sheets("База").Cells(i, 16) = "Да" Else Sheets("База").Cells(i, 16) = "Нет"

If cb_insidepdd.Value = True Then Sheets("База").Cells(i, 23) = "Да" Else Sheets("База").Cells(i, 23) = "Нет"

If cb_insidedrive.Value = True Then Sheets("База").Cells(i, 24) = "Да" Else Sheets("База").Cells(i, 24) = "Нет"

If cb_insidegorod.Value = True Then Sheets("База").Cells(i, 25) = "Да" Else Sheets("База").Cells(i, 25) = "Нет"

If cb_gaipdd.Value = True Then Sheets("База").Cells(i, 26) = "Да" Else Sheets("База").Cells(i, 26) = "Нет"

If cb_gaidrive.Value = True Then Sheets("База").Cells(i, 27) = "Да" Else Sheets("База").Cells(i, 27) = "Нет"

If cb_gaigorod.Value = True Then Sheets("База").Cells(i, 28) = "Да" Else Sheets("База").Cells(i, 28) = "Нет"

Sheets("База").Cells(i, 20) = desc_howmuchdrive.Text

Страницы: 1, 2, 3, 4, 5, 6, 7



2012 © Все права защищены
При использовании материалов активная ссылка на источник обязательна.