Форум программистов, компьютерный форум, киберфорум
C++ Builder
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.71/7: Рейтинг темы: голосов - 7, средняя оценка - 4.71
1 / 1 / 0
Регистрация: 22.01.2014
Сообщений: 99

Разработка приложения приёма и обработки заявок для почтового отделения

14.04.2017, 17:21. Показов 1484. Ответов 6
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Ребята, всем привет!
Нужна ваша помощь. У меня есть код программы, написанный на C++, но он без пояснения. Я сброшу сюда этот код, пожалуйста можете в этом коде программы поставить подробные комментарии с пояснениями, чтобы было понятно что делается в программе и что написано в коде программы.
0
IT_Exp
Эксперт
34794 / 4073 / 2104
Регистрация: 17.06.2006
Сообщений: 32,602
Блог
14.04.2017, 17:21
Ответы с готовыми решениями:

ASP.NET и приложения для приёма заявок
Стоит задача разработать корпортаивное приложение на подобии Service Desk, то есть пользователь заходит на внутренний ресурс, и там есть...

Разработка модели почтового отделения
Помогите сделать! В почтовое отделение поступает пуассоновский поток клиентов со средним временем появления 5 минут. Первоначально...

Разработка клиент-серверного приложения для удаленной обработки изображений
Разработка клиент-серверного приложения для удаленной обработки изображений. Может у кого есть примеры исходников?

6
1 / 1 / 0
Регистрация: 22.01.2014
Сообщений: 99
15.04.2017, 23:58  [ТС]
Ребята, помогите с программой. Программа написана на C++. Вот код программы, в нём нужно расставить комментарии, чтобы было понятно, что делается в этой программе.
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//---------------------------------------------------------------------------
 
#include <vcl.h>
#pragma hdrstop
 
#include "addklient.h"
#include "dm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tfaddklient *faddklient;
//---------------------------------------------------------------------------
__fastcall Tfaddklient::Tfaddklient(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tfaddklient::Button2Click(TObject *Sender)
{
faddklient->Close();
}
//---------------------------------------------------------------------------
void __fastcall Tfaddklient::Button1Click(TObject *Sender)
{
if (DBEdit1->Text!="" && DBEdit2->Text!="" && DBEdit3->Text!="") {
   fdm->klient->Post();
   ShowMessage("Клиент успешно добавлен");
   faddklient->Close();
}
else
ShowMessage("Все поля обязательны к заполнению!");
}
//---------------------------------------------------------------------------
void __fastcall Tfaddklient::FormClose(TObject *Sender, TCloseAction &Action)
{
   fdm->klient->Cancel();
}
//---------------------------------------------------------------------------
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//---------------------------------------------------------------------------
 
#include <vcl.h>
#pragma hdrstop
 
#include "addreq.h"
#include "dm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tfaddreq *faddreq;
//---------------------------------------------------------------------------
__fastcall Tfaddreq::Tfaddreq(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tfaddreq::FormActivate(TObject *Sender)
{
fdm->delreq->Insert();
fdm->search->Active=false;
}
//---------------------------------------------------------------------------
 
void __fastcall Tfaddreq::Button1Click(TObject *Sender)
{
fdm->search->Active=false;
fdm->search->SQL->Clear();
fdm->search->SQL->Add("select search.id_search,search.name_klient,search.adres_search,search.status,types.name_type,search.about from search left join types on search.id_type=types.id_type where types.name_type='"+DBLookupComboBox2->Text+"' and search.name_klient='"+DBLookupComboBox1->Text+"' and search.adres_search='"+DBEdit2->Text+"'");
fdm->search->Active=true;
ShowMessage("В результате поиска найдено "+IntToStr(fdm->search->RecordCount)+" записей");
}
//---------------------------------------------------------------------------
void __fastcall Tfaddreq::FormClose(TObject *Sender, TCloseAction &Action)
{
fdm->delreq->Cancel();
}
//---------------------------------------------------------------------------
void __fastcall Tfaddreq::Button2Click(TObject *Sender)
{
TDateTime Date;
if (fdm->search->RecordCount>0) {
   ShowMessage("Нельзя добавить заявку. Т.к. данные можно получить в вышепредставленной таблицы!");
}
else
{
fdm->search->Active=false;
fdm->search->SQL->Clear();
fdm->search->SQL->Add("select search.id_search,search.name_klient,search.adres_search,search.status,types.name_type,search.about from search left join types on search.id_type=types.id_type where types.name_type='"+DBLookupComboBox2->Text+"' and search.name_klient='"+DBLookupComboBox1->Text+"' and search.adres_search='"+DBEdit2->Text+"'");
fdm->search->Active=true;
    if (DBEdit1->Text!="" && DBEdit2->Text!="" && fdm->search->RecordCount==0) {
      fdm->delreq->FieldByName("status")->Value="В обработке";
      fdm->delreq->FieldByName("date_request")->Value=DateToStr(Date.CurrentDate());
      fdm->delreq->Post();
      ShowMessage("Заявка успешно добавлена!");
      fdm->request->Active=false;
      fdm->request->Active=true;
      faddreq->Close();
    }
}
}
//---------------------------------------------------------------------------
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//---------------------------------------------------------------------------
 
#include <vcl.h>
#pragma hdrstop
 
#include "adduser.h"
#include "dm.h"
#include "users.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tfeduser *feduser;
//---------------------------------------------------------------------------
__fastcall Tfeduser::Tfeduser(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tfeduser::FormClose(TObject *Sender, TCloseAction &Action)
{
  fdm->deluser->Cancel();
  fuser->Show();
 
}
//---------------------------------------------------------------------------
 
void __fastcall Tfeduser::Button2Click(TObject *Sender)
{
feduser->Close();
}
//---------------------------------------------------------------------------
void __fastcall Tfeduser::Button1Click(TObject *Sender)
{
if (ename->Text!="" && epas->Text!="" && elogin->Text!="") {
  etype->Text=ComboBox1->Text;
  fdm->deluser->Post();
  ShowMessage("Данные успешно сохранены!");
  feduser->Close();
}
else
    ShowMessage("Все поля обязательны для заполнения!");
}
//---------------------------------------------------------------------------
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//---------------------------------------------------------------------------
 
#include <vcl.h>
#pragma hdrstop
 
#include "request.h"
#include "dm.h"
#include "menu1.h"
#include "edstatus.h"
#include "addreq.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tfrequest *frequest;
//---------------------------------------------------------------------------
__fastcall Tfrequest::Tfrequest(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::FormClose(TObject *Sender, TCloseAction &Action)
{
fmenu->Show();
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::FormActivate(TObject *Sender)
{
//добавление типов
stype->Items->Clear();
stype->Items->Add("-");
fdm->types->First();
while (!fdm->types->Eof){
    stype->Items->Add(fdm->types->FieldByName("name_type")->Value);
    fdm->types->Next();
}
stype->ItemIndex=0;
 
 
//добавление пользователей
suser->Items->Clear();
suser->Items->Add("-");
fdm->deluser->First();
while (!fdm->deluser->Eof){
    suser->Items->Add(fdm->deluser->FieldByName("name_user")->Value);
    fdm->deluser->Next();
}
suser->ItemIndex=0;
 
//добавление списка клиентов
sname->Items->Clear();
sname->Items->Add("-");
fdm->klient->First();
while (!fdm->klient->Eof){
    sname->Items->Add(fdm->klient->FieldByName("name_klient")->Value);
    fdm->klient->Next();
}
sname->ItemIndex=0;
 
sstatus->Text="-";
sadres->Text="";
sabout->Text="";
fdm->search->Active=false;
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::sadresChange(TObject *Sender)
{
fdm->request->Active=false;
fdm->request->SQL->Clear();
fdm->request->SQL->Add("select request.id_request, request.date_request,request.adres_request,klient.name_klient, request.about, request.status, types.name_type, useres.name_user from request left join klient on request.id_klient=klient.id_klient left join useres on request.id_user=useres.id_user left join types on request.id_type=types.id_type where request.id_request>0");
if (sname->Text!="-") fdm->request->SQL->Add(" and klient.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->request->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="-") fdm->request->SQL->Add(" and request.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->request->SQL->Add(" and request.adres_request like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->request->SQL->Add(" and request.about like '%"+sabout->Text+"%'");
if (suser->Text!="-") fdm->request->SQL->Add(" and useres.name_user='"+suser->Text+"'");
fdm->request->Active=true;
}
//---------------------------------------------------------------------------
 
void __fastcall Tfrequest::saboutChange(TObject *Sender)
{
fdm->request->Active=false;
fdm->request->SQL->Clear();
fdm->request->SQL->Add("select request.id_request, request.date_request,request.adres_request,klient.name_klient, request.about, request.status, types.name_type, useres.name_user from request left join klient on request.id_klient=klient.id_klient left join useres on request.id_user=useres.id_user left join types on request.id_type=types.id_type where request.id_request>0");
if (sname->Text!="-") fdm->request->SQL->Add(" and klient.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->request->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="-") fdm->request->SQL->Add(" and request.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->request->SQL->Add(" and request.adres_request like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->request->SQL->Add(" and request.about like '%"+sabout->Text+"%'");
if (suser->Text!="-") fdm->request->SQL->Add(" and useres.name_user='"+suser->Text+"'");
fdm->request->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::stypeChange(TObject *Sender)
{
fdm->request->Active=false;
fdm->request->SQL->Clear();
fdm->request->SQL->Add("select request.id_request, request.date_request,request.adres_request,klient.name_klient, request.about, request.status, types.name_type, useres.name_user from request left join klient on request.id_klient=klient.id_klient left join useres on request.id_user=useres.id_user left join types on request.id_type=types.id_type where request.id_request>0");
if (sname->Text!="-") fdm->request->SQL->Add(" and klient.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->request->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="-") fdm->request->SQL->Add(" and request.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->request->SQL->Add(" and request.adres_request like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->request->SQL->Add(" and request.about like '%"+sabout->Text+"%'");
if (suser->Text!="-") fdm->request->SQL->Add(" and useres.name_user='"+suser->Text+"'");
fdm->request->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::snameChange(TObject *Sender)
{
fdm->request->Active=false;
fdm->request->SQL->Clear();
fdm->request->SQL->Add("select request.id_request, request.date_request,request.adres_request,klient.name_klient, request.about, request.status, types.name_type, useres.name_user from request left join klient on request.id_klient=klient.id_klient left join useres on request.id_user=useres.id_user left join types on request.id_type=types.id_type where request.id_request>0");
if (sname->Text!="-") fdm->request->SQL->Add(" and klient.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->request->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="-") fdm->request->SQL->Add(" and request.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->request->SQL->Add(" and request.adres_request like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->request->SQL->Add(" and request.about like '%"+sabout->Text+"%'");
if (suser->Text!="-") fdm->request->SQL->Add(" and useres.name_user='"+suser->Text+"'");
fdm->request->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::sstatusChange(TObject *Sender)
{
fdm->request->Active=false;
fdm->request->SQL->Clear();
fdm->request->SQL->Add("select request.id_request, request.date_request,request.adres_request,klient.name_klient, request.about, request.status, types.name_type, useres.name_user from request left join klient on request.id_klient=klient.id_klient left join useres on request.id_user=useres.id_user left join types on request.id_type=types.id_type where request.id_request>0");
if (sname->Text!="-") fdm->request->SQL->Add(" and klient.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->request->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="-") fdm->request->SQL->Add(" and request.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->request->SQL->Add(" and request.adres_request like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->request->SQL->Add(" and request.about like '%"+sabout->Text+"%'");
if (suser->Text!="-") fdm->request->SQL->Add(" and useres.name_user='"+suser->Text+"'");
fdm->request->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::suserChange(TObject *Sender)
{
fdm->request->Active=false;
fdm->request->SQL->Clear();
fdm->request->SQL->Add("select request.id_request, request.date_request,request.adres_request,klient.name_klient, request.about, request.status, types.name_type, useres.name_user from request left join klient on request.id_klient=klient.id_klient left join useres on request.id_user=useres.id_user left join types on request.id_type=types.id_type where request.id_request>0");
if (sname->Text!="-") fdm->request->SQL->Add(" and klient.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->request->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="-") fdm->request->SQL->Add(" and request.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->request->SQL->Add(" and request.adres_request like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->request->SQL->Add(" and request.about like '%"+sabout->Text+"%'");
if (suser->Text!="-") fdm->request->SQL->Add(" and useres.name_user='"+suser->Text+"'");
fdm->request->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::Button2Click(TObject *Sender)
{
0
1 / 1 / 0
Регистрация: 22.01.2014
Сообщений: 99
16.04.2017, 13:52  [ТС]
Продолжение и завершение кода:
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
if (fdm->request->RecordCount>0) {
if (MessageDlg("Удалить запись?", mtConfirmation,TMsgDlgButtons() << mbYes <<mbNo, 0) == mrYes){
fdm->delreq->Active=false;
fdm->delreq->SQL->Clear();
fdm->delreq->SQL->Add("select * from request where request.id_request="+fdm->request->FieldByName("id_request")->Value);
fdm->delreq->Active=true;
fdm->delreq->Delete();
fdm->request->Active=false;
fdm->request->Active=true;
ShowMessage("Запись удалена!");
}
}
else
ShowMessage("Нечего удалять!");
 
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::Button4Click(TObject *Sender)
{
fdm->search->Active=false;
fdm->search->SQL->Clear();
fdm->search->SQL->Add("select search.id_search,search.name_klient,search.adres_search,search.status,types.name_type,search.about from search left join types on search.id_type=types.id_type where types.name_type='"+fdm->request->FieldByName("name_type")->Value+"' and search.name_klient='"+fdm->request->FieldByName("name_klient")->Value+"' and search.adres_search='"+fdm->request->FieldByName("adres_request")->Value+"'");
fdm->search->Active=true;
ShowMessage("В результате поиска найдено "+IntToStr(fdm->search->RecordCount)+" записей");
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::Button3Click(TObject *Sender)
{
if (fdm->request->RecordCount>0) {
fedstatus->sstatus->Text=fdm->request->FieldByName("status")->Value;
fedstatus->ShowModal();
}
else
ShowMessage("Нечего изменять!");
 
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::Button1Click(TObject *Sender)
{
faddreq->ShowModal();
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::sdateChange(TObject *Sender)
{
fdm->request->Active=false;
fdm->request->SQL->Clear();
fdm->request->SQL->Add("select request.id_request, request.date_request,request.adres_request,klient.name_klient, request.about, request.status, types.name_type, useres.name_user from request left join klient on request.id_klient=klient.id_klient left join useres on request.id_user=useres.id_user left join types on request.id_type=types.id_type where request.date_request='"+DateToStr(sdate->Date)+"'");
if (sname->Text!="-") fdm->request->SQL->Add(" and klient.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->request->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="-") fdm->request->SQL->Add(" and request.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->request->SQL->Add(" and request.adres_request like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->request->SQL->Add(" and request.about like '%"+sabout->Text+"%'");
if (suser->Text!="-") fdm->request->SQL->Add(" and useres.name_user='"+suser->Text+"'");
fdm->request->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall Tfrequest::DBGrid2TitleClick(TColumn *Column)
{
fdm->search->Sort=Column->FieldName;
}
//---------------------------------------------------------------------------
 
void __fastcall Tfrequest::DBGrid1TitleClick(TColumn *Column)
{
fdm->request->Sort=Column->FieldName;
}
//---------------------------------------------------------------------------
C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
//---------------------------------------------------------------------------
 
#include <vcl.h>
#pragma hdrstop
 
#include "search.h"
#include "dm.h"
#include "menu1.h"
#include "edsearch.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
Tfsearch *fsearch;
//---------------------------------------------------------------------------
__fastcall Tfsearch::Tfsearch(TComponent* Owner)
    : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall Tfsearch::FormActivate(TObject *Sender)
{
fdm->search->Active=false;
fdm->search->SQL->Clear();
fdm->search->SQL->Add("select search.id_search,search.name_klient,search.adres_search,search.status,types.name_type,search.about from search left join types on search.id_type=types.id_type");
fdm->search->Active=true;
 
//добавление типов
stype->Items->Clear();
stype->Items->Add("-");
fdm->types->First();
while (!fdm->types->Eof){
    stype->Items->Add(fdm->types->FieldByName("name_type")->Value);
    fdm->types->Next();
}
stype->ItemIndex=0;
 
//добавление списка клиентов
sname->Items->Clear();
sname->Items->Add("-");
fdm->klient->First();
while (!fdm->klient->Eof){
    sname->Items->Add(fdm->klient->FieldByName("name_klient")->Value);
    fdm->klient->Next();
}
sname->ItemIndex=0;
 
sadres->Text="";
sabout->Text="";
sstatus->Text="";
 
}
//---------------------------------------------------------------------------
void __fastcall Tfsearch::DBGrid2TitleClick(TColumn *Column)
{
fdm->search->Sort=Column->FieldName;
}
//---------------------------------------------------------------------------
void __fastcall Tfsearch::snameChange(TObject *Sender)
{
fdm->search->Active=false;
fdm->search->SQL->Clear();
fdm->search->SQL->Add("select search.id_search,search.name_klient,search.adres_search,search.status,types.name_type,search.about from search left join types on search.id_type=types.id_type where search.id_search>0");
if (sname->Text!="-") fdm->search->SQL->Add(" and search.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->search->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="") fdm->search->SQL->Add(" and search.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->search->SQL->Add(" and search.adres_search like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->search->SQL->Add(" and search.about like '%"+sabout->Text+"%'");
fdm->search->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall Tfsearch::FormClose(TObject *Sender, TCloseAction &Action)
{
fmenu->Show();
}
//---------------------------------------------------------------------------
void __fastcall Tfsearch::sadresChange(TObject *Sender)
{
fdm->search->Active=false;
fdm->search->SQL->Clear();
fdm->search->SQL->Add("select search.id_search,search.name_klient,search.adres_search,search.status,types.name_type,search.about from search left join types on search.id_type=types.id_type where search.id_search>0");
if (sname->Text!="-") fdm->search->SQL->Add(" and search.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->search->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="") fdm->search->SQL->Add(" and search.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->search->SQL->Add(" and search.adres_search like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->search->SQL->Add(" and search.about like '%"+sabout->Text+"%'");
fdm->search->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall Tfsearch::sstatusChange(TObject *Sender)
{
fdm->search->Active=false;
fdm->search->SQL->Clear();
fdm->search->SQL->Add("select search.id_search,search.name_klient,search.adres_search,search.status,types.name_type,search.about from search left join types on search.id_type=types.id_type where search.id_search>0");
if (sname->Text!="-") fdm->search->SQL->Add(" and search.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->search->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="") fdm->search->SQL->Add(" and search.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->search->SQL->Add(" and search.adres_search like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->search->SQL->Add(" and search.about like '%"+sabout->Text+"%'");
fdm->search->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall Tfsearch::stypeChange(TObject *Sender)
{
fdm->search->Active=false;
fdm->search->SQL->Clear();
fdm->search->SQL->Add("select search.id_search,search.name_klient,search.adres_search,search.status,types.name_type,search.about from search left join types on search.id_type=types.id_type where search.id_search>0");
if (sname->Text!="-") fdm->search->SQL->Add(" and search.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->search->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="") fdm->search->SQL->Add(" and search.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->search->SQL->Add(" and search.adres_search like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->search->SQL->Add(" and search.about like '%"+sabout->Text+"%'");
fdm->search->Active=true;
}
//---------------------------------------------------------------------------
void __fastcall Tfsearch::saboutChange(TObject *Sender)
{
fdm->search->Active=false;
fdm->search->SQL->Clear();
fdm->search->SQL->Add("select search.id_search,search.name_klient,search.adres_search,search.status,types.name_type,search.about from search left join types on search.id_type=types.id_type where search.id_search>0");
if (sname->Text!="-") fdm->search->SQL->Add(" and search.name_klient='"+sname->Text+"'");
if (stype->Text!="-") fdm->search->SQL->Add(" and types.name_type='"+stype->Text+"'");
if (sstatus->Text!="") fdm->search->SQL->Add(" and search.status='"+sstatus->Text+"'");
if (sadres->Text!="") fdm->search->SQL->Add(" and search.adres_search like '%"+sadres->Text+"%'");
if (sabout->Text!="") fdm->search->SQL->Add(" and search.about like '%"+sabout->Text+"%'");
fdm->search->Active=true;
}
//---------------------------------------------------------------------------
 
void __fastcall Tfsearch::Button2Click(TObject *Sender)
{
if (fdm->search->RecordCount>0) {
if (MessageDlg("Удалить запись?", mtConfirmation,TMsgDlgButtons() << mbYes <<mbNo, 0) == mrYes){
fdm->delsearch->Active=false;
fdm->delsearch->SQL->Clear();
fdm->delsearch->SQL->Add("select * from search where id_search="+fdm->search->FieldByName("id_search")->Value);
fdm->delsearch->Active=true;
fdm->delsearch->Delete();
fdm->search->Active=false;
fdm->search->Active=true;
ShowMessage("Запись удалена!");
}
}
else
ShowMessage("Нечего удалять!");
}
//---------------------------------------------------------------------------
void __fastcall Tfsearch::Button3Click(TObject *Sender)
{
if (fdm->search->RecordCount>0) {
fedsearch->sname->Items->Clear();
fdm->klient->First();
while (!fdm->klient->Eof){
    fedsearch->sname->Items->Add(fdm->klient->FieldByName("name_klient")->Value);
    fdm->klient->Next();
}
fdm->delsearch->Edit();
fedsearch->sname->Text=fdm->delsearch->FieldByName("name_klient")->Value;
fedsearch->ShowModal();
}
else
ShowMessage("Нечего редактировать!");
}
//---------------------------------------------------------------------------
void __fastcall Tfsearch::Button1Click(TObject *Sender)
{
fdm->delsearch->Insert();
fedsearch->sname->Items->Clear();
fdm->klient->First();
while (!fdm->klient->Eof){
    fedsearch->sname->Items->Add(fdm->klient->FieldByName("name_klient")->Value);
    fdm->klient->Next();
}
fedsearch->ShowModal();
}
//---------------------------------------------------------------------------
Добавлено через 13 часов 53 минуты
Помогите кто с комментариями в этом коде.
0
1 / 1 / 0
Регистрация: 22.01.2014
Сообщений: 99
19.04.2017, 16:44  [ТС]
Народ, ну помогите кто-нибудь с программой, пожалуйста!
Расставьте комментарии в этом коде.

Добавлено через 23 часа 19 минут
Ну кто-нибудь поможет? Что вы за люди такие. Прошу же по человечески.
Тут же сидят все такие самые умные программисты, так что сложно таким программистам в этой программе комментарии расставить?
0
1 / 1 / 0
Регистрация: 22.01.2014
Сообщений: 99
21.04.2017, 16:13  [ТС]
Программисты? вы там что, вымерли все? В лом помочь?
0
 Аватар для Dinkin
783 / 556 / 136
Регистрация: 31.05.2013
Сообщений: 3,150
Записей в блоге: 3
21.04.2017, 16:32
Доброго. Там просто запросы к БД (не знаю что за БД)...и получения результатов от БД и все. Комментарии излишни, достаточна вам просто посмотреть на запросы, что они делают.
0
управление сложностью
 Аватар для Почтальон
1693 / 1306 / 259
Регистрация: 22.03.2015
Сообщений: 7,545
Записей в блоге: 5
21.04.2017, 22:37
Цитата Сообщение от Вова59 Посмотреть сообщение
Программисты? вы там что, вымерли все? В лом помочь?
А с чего вы взяли, что вам кто-то должен ? Давайте на первый раз пока предупреждение.
0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
BasicMan
Эксперт
29316 / 5623 / 2384
Регистрация: 17.02.2009
Сообщений: 30,364
Блог
21.04.2017, 22:37
Помогаю со студенческими работами здесь

БД Почтового отделения
Здравствуйте, есть ли у кого-нибудь БД Почтового отделения? Очень надо срочно,выручайте люди((((Заранее спасибо.

Учет подписки почтового отделения
Уважаемые форумчане киберфорума..прошу Вас помощь мне с написанием программы для курсовой на языке делфи тема &quot;Учет подписки почтового...

Нужно создать АИС почтового отделения
Доброго время суток!Есть проблема, нужно создать АИС почтового отделения, есть бд.в Access, нужно связать с delphi7, сделать выпадающие...

Записать данные обо всех подписчиках некоторого почтового отделения в файл
Необходимо записать данные обо всех подписчиках некоторого почтового отделения в файл. Формат сведений: индекс издания, газета(журнал),...

Программа приема заявок на техническое обслуживание
Программа приема заявок на техническое обслуживание при запуске считывает данные с БД и производит с ними действия. Потом сворачивается в...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
7
Ответ Создать тему
Новые блоги и статьи
Символьное дифференцирование
igorrr37 13.02.2026
/ * Программа принимает математическое выражение в виде строки и выдаёт его производную в виде строки и вычисляет значение производной при заданном х Логарифм записывается как: (x-2)log(x^2+2) -. . .
Камера Toupcam IUA500KMA
Eddy_Em 12.02.2026
Т. к. у всяких "хикроботов" слишком уж мелкий пиксель, для подсмотра в ESPriF они вообще плохо годятся: уже 14 величину можно рассмотреть еле-еле лишь на экспозициях под 3 секунды (а то и больше),. . .
И ясному Солнцу
zbw 12.02.2026
И ясному Солнцу, и светлой Луне. В мире покоя нет и люди не могут жить в тишине. А жить им немного лет.
«Знание-Сила»
zbw 12.02.2026
«Знание-Сила» «Время-Деньги» «Деньги -Пуля»
SDL3 для Web (WebAssembly): Подключение Box2D v3, физика и отрисовка коллайдеров
8Observer8 12.02.2026
Содержание блога Box2D - это библиотека для 2D физики для анимаций и игр. С её помощью можно определять были ли коллизии между конкретными объектами и вызывать обработчики событий столкновения. . . .
SDL3 для Web (WebAssembly): Загрузка PNG с прозрачным фоном с помощью SDL_LoadPNG (без SDL3_image)
8Observer8 11.02.2026
Содержание блога Библиотека SDL3 содержит встроенные инструменты для базовой работы с изображениями - без использования библиотеки SDL3_image. Пошагово создадим проект для загрузки изображения. . .
SDL3 для Web (WebAssembly): Загрузка PNG с прозрачным фоном с помощью SDL3_image
8Observer8 10.02.2026
Содержание блога Библиотека SDL3_image содержит инструменты для расширенной работы с изображениями. Пошагово создадим проект для загрузки изображения формата PNG с альфа-каналом (с прозрачным. . .
Установка Qt-версии Lazarus IDE в Debian Trixie Xfce
volvo 10.02.2026
В общем, достали меня глюки IDE Лазаруса, собранной с использованием набора виджетов Gtk2 (конкретно: если набирать текст в редакторе и вызвать подсказку через Ctrl+Space, то после закрытия окошка. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru