Unit Table_Sobstvennikov

Unit Avtorisation

3. procedure TFormavtosisation.ButtonopenClick(Sender: TObject);

4. begin

5. PostMessage(ProgressBarsagruska.Handle, $0409, 0, cllime);

6. timersagruski.Enabled:=true;

7. progressbarsagruska.Visible:=true;

8. labelsagruska.Visible:=true;

9. if ComboBoxusername.Text='Админ' then begin

10. formRequisites.dbEditadr.Enabled:=true;

11. formRequisites.dbEditnaimtsg.Enabled:=true;

12. formRequisites.dbedittel.Enabled:=true;

13. formRequisites.dbEditrs.Enabled:=true;

14. formRequisites.dbEditks.Enabled:=true;

15. formRequisites.dbEditinn.Enabled:=true;

16. formRequisites.dbEditbik Unit Table_Sobstvennikov.Enabled:=true;

17. formRequisites.Buttonsave.Visible:=true;

18. formRequisites.ButtonCancel.Visible:=true;

19. FormTableSobstvennikov.ButtonInsert.Visible:=true;

20. FormTableSobstvennikov.ButtonDelete.Visible:=true;

21. FormTableSobstvennikov.ButtonRedactor.Visible:=true;

22. FormTableSobstvennikov.ButtonCancel.Visible:=true;

23. FormTableSobstvennikov.ButtonSave.Visible:=true;

24. FormTableSobstvennikov.ButtonPrior.Visible:=true;

25. FormTableSobstvennikov.ButtonNext.Visible:=true;

26. FormTableSobstvennikov.DBGridSob.Enabled:=true;

27. formTarifes.DBGridVoda.Enabled:=true;

28. formTarifes.DBGridGiljo.Enabled:=true Unit Table_Sobstvennikov;

29. formTarifes.DBGridOtopl.Enabled:=true;

30. formTarifes.DBGridSvet.Enabled:=true;

31. formTarifes.DBGridObslug.Enabled:=true;

32. formTarifes.DBNavigatorvoda.Visible:=true;

33. formTarifes.DBNavigatorGiljo.Visible:=true;

34. formTarifes.DBNavigatorotopl.Visible:=true;

35. formTarifes.DBNavigatorsvet.Visible:=true;

36. formTarifes.DBNavigatorobslug.Visible:=true;

37. FormKvitanzia.dbeditkpvoda.Enabled:=true;

38. FormKvitanzia.dbeditkpgiljo.Enabled:=true;

39. FormKvitanzia.dbeditkpotopl.Enabled:=true;

40. FormKvitanzia.dbeditkpsvet.Enabled Unit Table_Sobstvennikov:=true;

41. FormKvitanzia.dbeditkpobslug.Enabled:=true;

42. FormKvitanzia.dbeditnpvoda.Enabled:=true;

43. FormKvitanzia.dbeditnpgiljo.Enabled:=true;

44. FormKvitanzia.dbeditnpotopl.Enabled:=true;

45. FormKvitanzia.dbeditnpsvet.Enabled:=true;

46. FormKvitanzia.dbeditnpobslug.Enabled:=true;

47. FormKvitanzia.dblookupcomboboxnumber.Enabled:=true;

48. FormKvitanzia.dblookupcomboboxls.Enabled:=true;

49. FormKvitanzia.dblookupcomboboxfio.Enabled:=true;

50. FormKvitanzia.dblookupcomboboxadr.Enabled:=true;

51. FormKvitanzia.dblookupcomboboxkolvo.Enabled:=true;

52. FormKvitanzia.dblookupcomboboxpl.Enabled:=true Unit Table_Sobstvennikov;

53. FormKvitanzia.dblookupcomboboxvoda.Enabled:=true;

54. FormKvitanzia.dblookupcomboboxgiljo.Enabled:=true;

55. FormKvitanzia.dblookupcomboboxotopl.Enabled:=true;

56. FormKvitanzia.dblookupcomboboxsvet.Enabled:=true;

57. FormKvitanzia.dblookupcomboboxobslug.Enabled:=true;

58. FormKvitanzia.Buttoncancel.visible:=true;

59. FormKvitanzia.Buttoninsert.visible:=true;

60. FormKvitanzia.Buttonsave.visible:=true;

61. FormKvitanzia.buttondelete.visible:=true;

62. FormKvitanzia.Buttonpoditig.visible:=true;

63. FormKvitanzia.Buttonprior.visible:=true;

64. FormKvitanzia.Buttonnext.visible:=true;

65. FormKvitanzia Unit Table_Sobstvennikov.Buttonquitredaction.visible:=true;

66. FormKvitanzia.Buttonkolvo.visible:=true;

67. FormKvitanzia.Buttonitogo.visible:=true;

68. Formmain.NDannieTSG.Visible:=true;

69. if editpassword.Text='' then

70. MessageDlg('Введите пароль', mtWarning, [mbOk], 0)

71. else

72. if Editpassword.Text='1234' then begin

73. progressbarSagruska.Visible:=true;

74. labelsagruska.Visible:=true;

75. timerSagruski.Enabled:=true;

76. end

77. else begin

78. progressbarSagruska.Visible:=true;

79. labelsagruska.Visible:=true;

80. timerSagruski.Enabled:=true;

81. end;

82. end;

83. if Unit Table_Sobstvennikov ComboBoxusername.Text='Сотрудник' then begin

84. formRequisites.dbEditadr.Enabled:=false;

85. formRequisites.dbEditnaimtsg.Enabled:=false;

86. formRequisites.dbedittel.Enabled:=false;

87. formRequisites.dbEditrs.Enabled:=false;

88. formRequisites.dbEditks.Enabled:=false;

89. formRequisites.dbEditinn.Enabled:=false;

90. formRequisites.dbEditbik.Enabled:=false;

91. formRequisites.Buttonsave.Visible:=false;

92. formRequisites.ButtonCancel.Visible:=false;

93. FormTableSobstvennikov.ButtonInsert.Visible:=true;

94. FormTableSobstvennikov.ButtonDelete.Visible:=true;

95. FormTableSobstvennikov.ButtonRedactor Unit Table_Sobstvennikov.Visible:=true;

96. FormTableSobstvennikov.ButtonCancel.Visible:=true;

97. FormTableSobstvennikov.ButtonSave.Visible:=true;

98. FormTableSobstvennikov.ButtonPrior.Visible:=true;

99. FormTableSobstvennikov.ButtonNext.Visible:=true;

100. FormTableSobstvennikov.DBGridSob.Enabled:=true;

101. formTarifes.DBGridVoda.Enabled:=true;

102. formTarifes.DBGridGiljo.Enabled:=true;

103. formTarifes.DBGridOtopl.Enabled:=true;

104. formTarifes.DBGridSvet.Enabled:=true;

105. formTarifes.DBGridObslug.Enabled:=true;

106. formTarifes.DBNavigatorvoda.Visible:=true;

107. formTarifes.DBNavigatorGiljo.Visible Unit Table_Sobstvennikov:=true;

108. formTarifes.DBNavigatorotopl.Visible:=true;

109. formTarifes.DBNavigatorsvet.Visible:=true;

110. formTarifes.DBNavigatorobslug.Visible:=true;

111. FormKvitanzia.dbeditkpvoda.Enabled:=true;

112. FormKvitanzia.dbeditkpgiljo.Enabled:=true;

113. FormKvitanzia.dbeditkpotopl.Enabled:=true;

114. FormKvitanzia.dbeditkpsvet.Enabled:=true;

115. FormKvitanzia.dbeditkpobslug.Enabled:=true;

116. FormKvitanzia.dbeditnpvoda.Enabled:=true;

117. FormKvitanzia.dbeditnpgiljo.Enabled:=true;

118. FormKvitanzia.dbeditnpotopl.Enabled:=true;

119. FormKvitanzia.dbeditnpsvet.Enabled:=true;

120. FormKvitanzia.dbeditnpobslug Unit Table_Sobstvennikov.Enabled:=true;

121. FormKvitanzia.dblookupcomboboxnumber.Enabled:=true;

122. FormKvitanzia.dblookupcomboboxls.Enabled:=true;

123. FormKvitanzia.dblookupcomboboxfio.Enabled:=true;

124. FormKvitanzia.dblookupcomboboxadr.Enabled:=true;

125. FormKvitanzia.dblookupcomboboxkolvo.Enabled:=true;

126. FormKvitanzia.dblookupcomboboxpl.Enabled:=true;

127. FormKvitanzia.dblookupcomboboxvoda.Enabled:=true;

128. FormKvitanzia.dblookupcomboboxgiljo.Enabled:=true;

129. FormKvitanzia.dblookupcomboboxotopl.Enabled:=true;

130. FormKvitanzia.dblookupcomboboxsvet.Enabled:=true;

131. FormKvitanzia.dblookupcomboboxobslug.Enabled:=true;

132. FormKvitanzia Unit Table_Sobstvennikov.Buttoncancel.visible:=true;

133. FormKvitanzia.Buttoninsert.visible:=true;

134. FormKvitanzia.Buttonsave.visible:=true;

135. FormKvitanzia.buttondelete.visible:=true;

136. FormKvitanzia.Buttonpoditig.visible:=true;

137. FormKvitanzia.Buttonprior.visible:=true;

138. FormKvitanzia.Buttonnext.visible:=true;

139. FormKvitanzia.Buttonquitredaction.visible:=true;

140. FormKvitanzia.Buttonkolvo.visible:=true;

141. FormKvitanzia.Buttonitogo.visible:=true;

142. Formmain.NDannieTSG.Visible:=false;

143. end;

144. if ComboBoxusername.Text='Юзер Unit Table_Sobstvennikov' then begin

145. formRequisites.dbEditadr.Enabled:=false;

146. formRequisites.dbEditnaimtsg.Enabled:=false;

147. formRequisites.dbedittel.Enabled:=false;

148. formRequisites.dbEditrs.Enabled:=false;

149. formRequisites.dbEditks.Enabled:=false;

150. formRequisites.dbEditinn.Enabled:=false;

151. formRequisites.dbEditbik.Enabled:=false;

152. formRequisites.Buttonsave.Visible:=false;

153. formRequisites.ButtonCancel.Visible:=false;

154. FormTableSobstvennikov.ButtonInsert.Visible:=false;

155. FormTableSobstvennikov.ButtonDelete.Visible:=false;

156. FormTableSobstvennikov.ButtonRedactor.Visible:=false;

157. FormTableSobstvennikov.ButtonCancel Unit Table_Sobstvennikov.Visible:=false;

158. FormTableSobstvennikov.ButtonSave.Visible:=false;

159. FormTableSobstvennikov.ButtonPrior.Visible:=false;

160. FormTableSobstvennikov.ButtonNext.Visible:=false;

161. FormTableSobstvennikov.DBGridSob.Enabled:=false;

162. formTarifes.DBGridVoda.Enabled:=false;

163. formTarifes.DBGridGiljo.Enabled:=false;

164. formTarifes.DBGridOtopl.Enabled:=false;

165. formTarifes.DBGridSvet.Enabled:=false;

166. formTarifes.DBGridObslug.Enabled:=false;

167. formTarifes.DBNavigatorvoda.Visible:=false;

168. formTarifes.DBNavigatorGiljo.Visible:=false;

169. formTarifes Unit Table_Sobstvennikov.DBNavigatorotopl.Visible:=false;

170. formTarifes.DBNavigatorsvet.Visible:=false;

171. formTarifes.DBNavigatorobslug.Visible:=false;

172. FormKvitanzia.dbeditkpvoda.Enabled:=false;

173. FormKvitanzia.dbeditkpgiljo.Enabled:=false;

174. FormKvitanzia.dbeditkpotopl.Enabled:=false;

175. FormKvitanzia.dbeditkpsvet.Enabled:=false;

176. FormKvitanzia.dbeditkpobslug.Enabled:=false;

177. FormKvitanzia.dbeditnpvoda.Enabled:=false;

178. FormKvitanzia.dbeditnpgiljo.Enabled:=false;

179. FormKvitanzia.dbeditnpotopl.Enabled:=false;

180. FormKvitanzia.dbeditnpsvet.Enabled:=false;

181. FormKvitanzia.dbeditnpobslug Unit Table_Sobstvennikov.Enabled:=false;

182. FormKvitanzia.dblookupcomboboxnumber.Enabled:=false;

183. FormKvitanzia.dblookupcomboboxls.Enabled:=false;

184. FormKvitanzia.dblookupcomboboxfio.Enabled:=false;

185. FormKvitanzia.dblookupcomboboxadr.Enabled:=false;

186. FormKvitanzia.dblookupcomboboxkolvo.Enabled:=false;

187. FormKvitanzia.dblookupcomboboxpl.Enabled:=false;

188. FormKvitanzia.dblookupcomboboxvoda.Enabled:=false;

189. FormKvitanzia.dblookupcomboboxgiljo.Enabled:=false;

190. FormKvitanzia.dblookupcomboboxotopl.Enabled:=false;

191. FormKvitanzia.dblookupcomboboxsvet.Enabled:=false;

192. FormKvitanzia.dblookupcomboboxobslug.Enabled:=false;

193. FormKvitanzia.Buttoncancel.visible Unit Table_Sobstvennikov:=false;

194. FormKvitanzia.Buttoninsert.visible:=false;

195. FormKvitanzia.Buttonsave.visible:=false;

196. FormKvitanzia.buttondelete.visible:=false;

197. FormKvitanzia.Buttonpoditig.visible:=false;

198. FormKvitanzia.Buttonprior.visible:=false;

199. FormKvitanzia.Buttonnext.visible:=false;

200. FormKvitanzia.Buttonquitredaction.visible:=false;

201. FormKvitanzia.Buttonkolvo.visible:=false;

202. FormKvitanzia.Buttonitogo.visible:=false;

203. Formmain.NDannieTSG.Visible:=false;

204. end;

205. end;

206. procedure TFormavtosisation.ButtoncloseClick(Sender: TObject);

207. begin

208. close;

209. end Unit Table_Sobstvennikov;

210. procedure TFormavtosisation.TimerSagruskiTimer(Sender: TObject);

211. begin

212. v:=v+1;

213. ProgressBarSagruska.Position:=ProgressBarSagruska.Position+1;

214. labelsagruska.Caption:='Подождите, идёт загрузка на '+inttostr(v)+' %';

215. if (Editpassword.Text='1234') and (v=100) then begin

216. formavtosisation.Hide;

217. formmain.Show;

218. v:=0;

219. ProgressBarSagruska.Position:=0;

220. timerSagruski.Enabled:=false;

221. labelsagruska.Visible:=false;

222. progressbarSagruska.Visible:=false;

223. end else begin

224. if (Editpassword.Text'1234') and (v=100) then Unit Table_Sobstvennikov begin

225. v:=0;

226. ProgressBarSagruska.Position:=0;

227. timerSagruski.Enabled:=false;

228. labelsagruska.Visible:=false;

229. progressbarSagruska.Visible:=false;

230. MessageDlg('Введен неправильный пароль!', mtError, [mbOk], 0);

231. end;

232. end;

233. end;

234. procedure TFormavtosisation.FormCreate(Sender: TObject);

235. begin

236. v:=0;

237. labelsagruska.Visible:=false;

238. end;

239. procedure TFormavtosisation.ComboBoxusernameChange(Sender: TObject);

240. begin

241. if (comboboxusername.Text'') and (editpassword.Text'') then

242. buttonopen.Enabled:=true else buttonopen.Enabled:=false;

243. end Unit Table_Sobstvennikov;

244. procedure TFormavtosisation.EditpasswordChange(Sender: TObject);

245. begin

246. if (comboboxusername.Text'') and (editpassword.Text'') then

247. buttonopen.Enabled:=true else buttonopen.Enabled:=false;

248. end;

249. procedure TFormavtosisation.EditpasswordKeyPress(Sender: TObject; var Key: Char);

250. begin

251. if (buttonopen.Enabled=true) and (key=#13) then Buttonopen.Click;

252. end;

253. procedure TFormavtosisation.ComboBoxusernameKeyPress(Sender: TObject; var Key: Char);

254. begin

255. key:=#0;

256. end;

257. procedure TFormavtosisation.EditloginKeyPress Unit Table_Sobstvennikov(Sender: TObject; var Key: Char);

258. begin

259. case Key of

260. #8,#32,#13,'A'..'Z','a'..'z','А'..'Я','а'..'я':;

261. else key:=chr(0);

262. end;

263. if (buttonopen.Enabled=true) and (key=#13) then Buttonopen.Click;

264. end;

265. procedure TFormavtosisation.EditloginChange(Sender: TObject);

266. begin

267. if (comboboxusername.Text'') and (editpassword.Text'') then

268. buttonopen.Enabled:=true else buttonopen.Enabled:=false Unit Table_Sobstvennikov;

269. end;

270. end.

Unit Main Form

272. procedure TFormMain.NCloseClick(Sender: TObject);

273. begin

274. formRequisites.Hide;

275. Formversion.Hide;

276. FormProgram.Hide;

277. FormTableSobstvennikov.Hide;

278. formTarifes.Hide;

279. FormKvitanzia.Hide;

280. FormExport.Hide;

281. if MessageBox(Handle, 'Вы уже желаете выйти?',

282. 'Доказательство выхода', MB_YESNO )= ID_YES then

283. Formavtosisation.Close;

284. end;

285. procedure TFormMain.NSmenaUseraClick(Sender: TObject);

286. begin

287. if MessageBox(Handle, 'Вы вправду Unit Table_Sobstvennikov желаете поменять юзера?',

288. 'Доказательство смены юзера', MB_YESNO )= ID_YES then begin

289. Formavtosisation.show;

290. FormMain.Hide;

291. formRequisites.Hide;

292. Formversion.Hide;

293. FormProgram.Hide;

294. FormTableSobstvennikov.Hide;

295. formTarifes.Hide;

296. FormKvitanzia.Hide;

297. FormExport.Hide;

298. Formavtosisation.editpassword.Clear;

299. Formavtosisation.comboboxusername.Text:='';

300. end;

301. end;

302. procedure TFormMain.FormClose(Sender: TObject; var Action: TCloseAction);

303. begin

304. if MessageBox(Handle, 'Вы Unit Table_Sobstvennikov уже желаете выйти?',

305. 'Доказательство выхода', MB_YESNO )= ID_YES then

306. Formavtosisation.Close;

307. end;

308. procedure TFormMain.NProgramClick(Sender: TObject);

309. begin

310. FormProgram.show;

311. end;

312. procedure TFormMain.SpeedButtonSobstvennikiClick(Sender: TObject);

313. begin

314. FormTableSobstvennikov.show;

315. FormTableSobstvennikov.Buttoncancel.Click;

316. end;

317. procedure TFormMain.SpeedButtonTarifesClick(Sender: TObject);

318. begin

319. formTarifes.show;

320. end;

321. procedure TFormMain.SpeedButtonKvitanziaClick(Sender: TObject);

322. begin

323. FormKvitanzia.show;

324. FormKvitanzia.Buttoncancel Unit Table_Sobstvennikov.Click;

325. FormKvitanzia.DBtextinn.caption:=formRequisites.dbEditinn.Text;

326. FormKvitanzia.DBtextbik.caption:=formRequisites.dbEditbik.Text;

327. FormKvitanzia.DBtextrs.caption:=formRequisites.dbEditrs.Text;

328. FormKvitanzia.DBtextks.caption:=formRequisites.dbEditks.Text;

329. {FormKvitanzia.DBtextvoda.caption:=formTarifes.dbeditnaimvoda.Text;

330. FormKvitanzia.DBtextgiljo.caption:=formTarifes.dbeditnaimgiljo.Text;

331. FormKvitanzia.DBtextotopl.caption:=formTarifes.dbeditnaimotopl.Text;

332. FormKvitanzia.DBtextsvet.caption:=formTarifes.dbeditnaimsvet.Text Unit Table_Sobstvennikov;

333. FormKvitanzia.DBtextobslug.caption:=formTarifes.dbeditnaimobslug.Text;

334. {FormKvitanzia.DBtextedvoda.caption:=formTarifes.dbeditedvoda.Text;

335. FormKvitanzia.DBtextedgiljo.caption:=formTarifes.dbeditedgiljo.Text;

336. FormKvitanzia.DBtextedotopl.caption:=formTarifes.dbeditedotopl.Text;

337. FormKvitanzia.DBtextedsvet.caption:=formTarifes.dbeditedsvet.Text;

338. FormKvitanzia.DBtextedobslug.caption:=formTarifes.dbeditedobslug.Text;}

339. end;

340. procedure TFormMain.NRequisitesClick(Sender: TObject);

341. begin

342. formRequisites.show;

343. end;

344. procedure TFormMain.NRabotaProgramClick(Sender: TObject Unit Table_Sobstvennikov);

345. begin

346. ShellExecute (Handle, 'open', PChar ('Справка 1.chm'), nil, nil, SW_RESTORE);

347. end;

348. procedure TFormMain.NVersionClick(Sender: TObject);

349. begin

350. formversion.Show;

351. end;

352. end.

Unit Requisites

354. procedure TFormRequisites.DBEditksClick(Sender: TObject);

355. begin

356. if (Length(dbEditks.Text)<20) then

357. MessageDlg('Ввод К/С содержит только 20 цифр', mtWarning, [mbOk], 0);

358. end;

359. procedure TFormRequisites.DBEditrsClick(Sender: TObject);

360. begin

361. if (Length(dbEditrs Unit Table_Sobstvennikov.Text)<20) then

362. MessageDlg('Ввод Р/С содержит только 20 цифр', mtWarning, [mbOk], 0);

363. end;

364. procedure TFormRequisites.DBEditinnClick(Sender: TObject);

365. begin

366. if (Length(dbEditinn.Text)<12) then

367. MessageDlg('Ввод ИНН содержит только 12 цифр', mtWarning, [mbOk], 0);

368. end;

369. procedure TFormRequisites.DBEditbikClick(Sender: TObject);

370. begin

371. if (Length(dbEditbik.Text)<9) then

372. MessageDlg('Ввод БИК содержит только 9 цифр', mtWarning, [mbOk], 0);

373. end;

374. procedure TFormRequisites.DBEdittelClick(Sender Unit Table_Sobstvennikov: TObject);

375. begin

376. //dbedittel.Field.EditMask:='!+7(000)-000-00-00;1;';

377. end;

378. procedure TFormRequisites.ButtonSaveClick(Sender: TObject);

379. begin

380. if DataModuleDFM.ADOTableRequisites.Modified then DataModuleDFM.ADOTableRequisites.Post;

381. formRequisites.Hide;

382. end;

383. procedure TFormRequisites.ButtonCancelClick(Sender: TObject);

384. begin

385. DataModuleDFM.ADOTableRequisites.Cancel;

386. formRequisites.Hide;

387. end;

388. procedure TFormRequisites.FormClose(Sender: TObject; var Action: TCloseAction);

389. begin

390. DataModuleDFM.ADOTableRequisites.Cancel;

391. formRequisites.Hide;

392. end;

393. procedure TFormRequisites.DBEditadrChange Unit Table_Sobstvennikov(Sender: TObject);

394. begin

395. if (DBEditadr.Text'') and (DBEditnaimtsg.Text'') and (DBEditteln1.Text'') and (DBEditteln2.Text'')

396. and (DBEditinn.Text'') and (DBEditbik.Text'') and (DBEditrs.Text'') and (DBEditks.Text'')

397. and (DBEditteln3.Text'') and (DBEditteln4.Text'') and (Length(dbEditteln1.Text)=3) and (Length(dbEditinn.Text)=12)

398. and (Length(dbEditteln2.Text)=3) and (Length(dbEditteln3.Text Unit Table_Sobstvennikov)=2) and (Length(dbEditteln4.Text)=2)

399. and (Length(dbEditbik.Text)=9) and (Length(dbEditrs.Text)=20) and (Length(dbEditks.Text)=20) then

400. buttonsave.Enabled:=true else buttonsave.Enabled:=false;

401. end;

402. procedure TFormRequisites.DBEditnaimtsgChange(Sender: TObject);

403. begin

404. if (DBEditadr.Text'') and (DBEditnaimtsg.Text'') and (DBEditteln1.Text'') and (DBEditteln2.Text'')

405. and (DBEditinn.Text'') and (DBEditbik.Text'') and (DBEditrs.Text Unit Table_Sobstvennikov'') and (DBEditks.Text'')

406. and (DBEditteln3.Text'') and (DBEditteln4.Text'') and (Length(dbEditteln1.Text)=3) and (Length(dbEditinn.Text)=12)

407. and (Length(dbEditteln2.Text)=3) and (Length(dbEditteln3.Text)=2) and (Length(dbEditteln4.Text)=2)

408. and (Length(dbEditbik.Text)=9) and (Length(dbEditrs.Text)=20) and (Length(dbEditks.Text)=20) then

409. buttonsave.Enabled:=true else buttonsave.Enabled Unit Table_Sobstvennikov:=false;

410. end;

411. procedure TFormRequisites.DBEdittelChange(Sender: TObject);

412. begin

413. if (DBEditadr.Text'') and (DBEditnaimtsg.Text'') and (DBEditteln1.Text'') and (DBEditteln2.Text'')

414. and (DBEditinn.Text'') and (DBEditbik.Text'') and (DBEditrs.Text'') and (DBEditks.Text'')

415. and (DBEditteln3.Text'') and (DBEditteln4.Text'') then

416. buttonsave.Enabled:=true else buttonsave.Enabled:=false;

417. end;

418. procedure TFormRequisites.DBEditinnChange(Sender: TObject);

419. begin

420. if Unit Table_Sobstvennikov (DBEditadr.Text'') and (DBEditnaimtsg.Text'') and (DBEditteln1.Text'') and (DBEditteln2.Text'')

421. and (DBEditinn.Text'') and (DBEditbik.Text'') and (DBEditrs.Text'') and (DBEditks.Text'')

422. and (DBEditteln3.Text'') and (DBEditteln4.Text'') and (Length(dbEditteln1.Text)=3) and (Length(dbEditinn.Text)=12)

423. and (Length(dbEditteln2.Text)=3) and (Length(dbEditteln3.Text)=2) and (Length Unit Table_Sobstvennikov(dbEditteln4.Text)=2)

424. and (Length(dbEditbik.Text)=9) and (Length(dbEditrs.Text)=20) and (Length(dbEditks.Text)=20) then

425. buttonsave.Enabled:=true else buttonsave.Enabled:=false;

426. end;

427. procedure TFormRequisites.DBEditbikChange(Sender: TObject);

428. begin

429. if (DBEditadr.Text'') and (DBEditnaimtsg.Text'') and (DBEditteln1.Text'') and (DBEditteln2.Text'')

430. and (DBEditinn.Text'') and (DBEditbik.Text'') and (DBEditrs.Text'') and (DBEditks Unit Table_Sobstvennikov.Text'')

431. and (DBEditteln3.Text'') and (DBEditteln4.Text'') and (Length(dbEditteln1.Text)=3) and (Length(dbEditinn.Text)=12)

432. and (Length(dbEditteln2.Text)=3) and (Length(dbEditteln3.Text)=2) and (Length(dbEditteln4.Text)=2)

433. and (Length(dbEditbik.Text)=9) and (Length(dbEditrs.Text)=20) and (Length(dbEditks.Text)=20) then

434. buttonsave.Enabled:=true else buttonsave.Enabled:=false;

435. end;

436. procedure Unit Table_Sobstvennikov TFormRequisites.DBEditrsChange(Sender: TObject);

437. begin

438. if (DBEditadr.Text'') and (DBEditnaimtsg.Text'') and (DBEditteln1.Text'') and (DBEditteln2.Text'')

439. and (DBEditinn.Text'') and (DBEditbik.Text'') and (DBEditrs.Text'') and (DBEditks.Text'')

440. and (DBEditteln3.Text'') and (DBEditteln4.Text'') and (Length(dbEditteln1.Text)=3) and (Length(dbEditinn.Text)=12)

441. and (Length(dbEditteln2.Text)=3) and (Length(dbEditteln3.Text)=2) and (Length Unit Table_Sobstvennikov(dbEditteln4.Text)=2)

442. and (Length(dbEditbik.Text)=9) and (Length(dbEditrs.Text)=20) and (Length(dbEditks.Text)=20) then

443. buttonsave.Enabled:=true else buttonsave.Enabled:=false;

444. end;

445. procedure TFormRequisites.DBEditksChange(Sender: TObject);

446. begin

447. if (DBEditadr.Text'') and (DBEditnaimtsg.Text'') and (DBEditteln1.Text'') and (DBEditteln2.Text'')

448. and (DBEditinn.Text'') and (DBEditbik.Text'') and (DBEditrs.Text'') and Unit Table_Sobstvennikov (DBEditks.Text'')

449. and (DBEditteln3.Text'') and (DBEditteln4.Text'') and (Length(dbEditteln1.Text)=3) and (Length(dbEditinn.Text)=12)

450. and (Length(dbEditteln2.Text)=3) and (Length(dbEditteln3.Text)=2) and (Length(dbEditteln4.Text)=2)

451. and (Length(dbEditbik.Text)=9) and (Length(dbEditrs.Text)=20) and (Length(dbEditks.Text)=20) then

452. buttonsave.Enabled:=true else buttonsave.Enabled:=false;

453. end;

454. procedure Unit Table_Sobstvennikov TFormRequisites.DBEditTelN1Change(Sender: TObject);

455. begin

456. s:=dbeditTelN1.Text;

457. dbedittel.text:='+7('+s+')-'+s1+'-'+s2+'-'+s3;

458. if (DBEditadr.Text'') and (DBEditnaimtsg.Text'') and (DBEditteln1.Text'') and (DBEditteln2.Text'')

459. and (DBEditinn.Text'') and (DBEditbik.Text'') and (DBEditrs.Text'') and (DBEditks.Text'')

460. and (DBEditteln3.Text'') and (DBEditteln4.Text'') and (Length(dbEditteln1.Text Unit Table_Sobstvennikov)=3) and (Length(dbEditinn.Text)=12)

461. and (Length(dbEditteln2.Text)=3) and (Length(dbEditteln3.Text)=2) and (Length(dbEditteln4.Text)=2)

462. and (Length(dbEditbik.Text)=9) and (Length(dbEditrs.Text)=20) and (Length(dbEditks.Text)=20) then

463. buttonsave.Enabled:=true else buttonsave.Enabled:=false;

464. end;

465. procedure TFormRequisites.DBEditTelN2Change(Sender: TObject);

466. begin

467. s1:=dbeditTelN2.Text;

468. dbedittel.text:='+7('+s+')-'+s Unit Table_Sobstvennikov1+'-'+s2+'-'+s3;

469. if (DBEditadr.Text'') and (DBEditnaimtsg.Text'') and (DBEditteln1.Text'') and (DBEditteln2.Text'')

470. and (DBEditinn.Text'') and (DBEditbik.Text'') and (DBEditrs.Text'') and (DBEditks.Text'')

471. and (DBEditteln3.Text'') and (DBEditteln4.Text'') and (Length(dbEditteln1.Text)=3) and (Length(dbEditinn.Text)=12)

472. and (Length(dbEditteln2.Text)=3) and (Length(dbEditteln3.Text)=2) and Unit Table_Sobstvennikov (Length(dbEditteln4.Text)=2)

473. and (Length(dbEditbik.Text)=9) and (Length(dbEditrs.Text)=20) and (Length(dbEditks.Text)=20) then

474. buttonsave.Enabled:=true else buttonsave.Enabled:=false; end;

475. procedure TFormRequisites.DBEditTelN3Change(Sender: TObject);

476. begin

477. s2:=dbeditTelN3.Text;

478. dbedittel.text:='+7('+s+')-'+s1+'-'+s2+'-'+s3;

479. if (DBEditadr.Text'') and (DBEditnaimtsg.Text'') and (DBEditteln1.Text'') and (DBEditteln2.Text Unit Table_Sobstvennikov'')

480. and (DBEditinn.Text'') and (DBEditbik.Text'') and (DBEditrs.Text'') and (DBEditks.Text'')

481. and (DBEditteln3.Text'') and (DBEditteln4.Text'') and (Length(dbEditteln1.Text)=3) and (Length(dbEditinn.Text)=12)

482. and (Length(dbEditteln2.Text)=3) and (Length(dbEditteln3.Text)=2) and (Length(dbEditteln4.Text)=2)

483. and (Length(dbEditbik.Text)=9) and (Length(dbEditrs.Text)=20) and (Length Unit Table_Sobstvennikov(dbEditks.Text)=20) then

484. buttonsave.Enabled:=true else buttonsave.Enabled:=false;

485. end;

486. procedure TFormRequisites.DBEditTelN4Change(Sender: TObject);

487. begin

488. s3:=dbeditTelN4.Text;

489. dbedittel.text:='+7('+s+')-'+s1+'-'+s2+'-'+s3;

490. if (DBEditadr.Text'') and (DBEditnaimtsg.Text'') and (DBEditteln1.Text'') and (DBEditteln2.Text'')

491. and (DBEditinn.Text'') and (DBEditbik.Text'') and (DBEditrs.Text'') and Unit Table_Sobstvennikov (DBEditks.Text'')

492. and (DBEditteln3.Text'') and (DBEditteln4.Text'') and (Length(dbEditteln1.Text)=3) and (Length(dbEditinn.Text)=12)

493. and (Length(dbEditteln2.Text)=3) and (Length(dbEditteln3.Text)=2) and (Length(dbEditteln4.Text)=2)

494. and (Length(dbEditbik.Text)=9) and (Length(dbEditrs.Text)=20) and (Length(dbEditks.Text)=20) then

495. buttonsave.Enabled:=true else buttonsave.Enabled:=false;

496. end;

497. procedure Unit Table_Sobstvennikov TFormRequisites.DBEditTelN1KeyPress(Sender: TObject;

498. var Key: Char);

499. begin

500. case Key of

501. #8,'0'..'9':;

502. else key:=chr(0); end;

503. if (Length(dbEditteln1.Text)>3) and (key#8) then key:=#0;

504. if not (Key in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

505. if not (Key in ['0'..'9', #8, DecimalSeparator]) then

506. MessageDlg('Разрешен ввод только цифрами ', mtWarning, [mbOk], 0);

507. if (Length(dbEditteln1.Text)>=3) and (key#8) then

508. MessageDlg('1-ый ввод номера Unit Table_Sobstvennikov ограничен тримя цифрами', mtWarning, [mbOk], 0);

509. end;

510. procedure TFormRequisites.DBEditTelN2KeyPress(Sender: TObject;

511. var Key: Char);

512. begin

513. case Key of

514. #8,'0'..'9':;

515. else key:=chr(0); end;

516. if (Length(dbEditteln2.Text)>3) and (key#8) then key:=#0;

517. if not (Key in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

518. if not (Key in ['0'..'9', #8, DecimalSeparator]) then

519. MessageDlg('Разрешен ввод только цифрами ', mtWarning Unit Table_Sobstvennikov, [mbOk], 0);

520. if (Length(dbEditteln2.Text)>=3) and (key#8) then

521. MessageDlg('2-ой ввод номера ограничен тримя цифрами', mtWarning, [mbOk], 0);

522. end;

523. procedure TFormRequisites.DBEditTelN3KeyPress(Sender: TObject;

524. var Key: Char);

525. begin

526. case Key of

527. #8,'0'..'9':;

528. else key:=chr(0); end;

529. if (Length(dbEditteln3.Text)>2) and (key#8) then key:=#0;

530. if not (Key in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

531. if not (Key in Unit Table_Sobstvennikov ['0'..'9', #8, DecimalSeparator]) then

532. MessageDlg('Разрешен ввод только цифрами ', mtWarning, [mbOk], 0);

533. if (Length(dbEditteln3.Text)>=2) and (key#8) then

534. MessageDlg('3-ий ввод номера ограничен 2-мя цифрами', mtWarning, [mbOk], 0);

535. end;

536. procedure TFormRequisites.DBEditTelN4KeyPress(Sender: TObject;

537. var Key: Char);

538. begin

539. case Key of

540. #8,'0'..'9':;

541. else key:=chr(0); end;

542. if (Length(dbEditteln4.Text)>2) and (key#8) then key:=#0;

543. if not (Key Unit Table_Sobstvennikov in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

544. if not (Key in ['0'..'9', #8, DecimalSeparator]) then

545. MessageDlg('Разрешен ввод только цифрами ', mtWarning, [mbOk], 0);

546. if (Length(dbEditteln4.Text)>=2) and (key#8) then

547. MessageDlg('Четвёртый ввод номера ограничен 2-мя цифрами', mtWarning, [mbOk], 0);

548. end;

549. procedure TFormRequisites.DBEditinnKeyPress(Sender: TObject;

550. var Key: Char);

551. begin

552. case Key of

553. #8,'0'..'9':;

554. else key:=chr(0); end Unit Table_Sobstvennikov;

555. if (Length(dbEditinn.Text)>12) and (key#8) then key:=#0;

556. if not (Key in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

557. if not (Key in ['0'..'9', #8, DecimalSeparator]) then

558. MessageDlg('Разрешен ввод только цифрами ', mtWarning, [mbOk], 0);

559. if (Length(dbEditinn.Text)>=12) and (key#8) then

560. MessageDlg('1-ый ввод номера ограничен только 12 цифрами', mtWarning, [mbOk], 0);

561. end;

562. procedure TFormRequisites.DBEditbikKeyPress(Sender: TObject;

563. var Key: Char);

564. begin

565. case Unit Table_Sobstvennikov Key of

566. #8,'0'..'9':;

567. else key:=chr(0); end;

568. if (Length(dbEditbik.Text)>9) and (key#8) then key:=#0;

569. if not (Key in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

570. if not (Key in ['0'..'9', #8, DecimalSeparator]) then

571. MessageDlg('Разрешен ввод только цифрами ', mtWarning, [mbOk], 0);

572. if (Length(dbEditbik.Text)>=9) and (key#8) then

573. MessageDlg('1-ый ввод номера ограничен только 9 цифрами', mtWarning, [mbOk], 0);

574. end;

575. procedure Unit Table_Sobstvennikov TFormRequisites.DBEditrsKeyPress(Sender: TObject; var Key: Char);

576. begin

577. case Key of

578. #8,'0'..'9':;

579. else key:=chr(0); end;

580. if (Length(dbEditrs.Text)>20) and (key#8) then key:=#0;

581. if not (Key in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

582. if not (Key in ['0'..'9', #8, DecimalSeparator]) then

583. MessageDlg('Разрешен ввод только цифрами ', mtWarning, [mbOk], 0);

584. if (Length(dbEditrs.Text)>=20) and (key Unit Table_Sobstvennikov#8) then

585. MessageDlg('1-ый ввод номера ограничен только 20 цифрами', mtWarning, [mbOk], 0);

586. end;

587. procedure TFormRequisites.DBEditksKeyPress(Sender: TObject; var Key: Char);

588. begin

589. case Key of

590. #8,'0'..'9':;

591. else key:=chr(0); end;

592. if (Length(dbEditks.Text)>20) and (key#8) then key:=#0;

593. if not (Key in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

594. if not (Key in ['0'..'9', #8, DecimalSeparator]) then

595. MessageDlg('Разрешен ввод только цифрами ', mtWarning, [mbOk], 0);

596. if Unit Table_Sobstvennikov (Length(dbEditks.Text)>=20) and (key#8) then

597. MessageDlg('1-ый ввод номера ограничен только 20 цифрами', mtWarning, [mbOk], 0);

598. end;

599. procedure TFormRequisites.DBEditTelN1Click(Sender: TObject);

600. begin

601. if (Length(dbEditTelN1.Text)<3) then

602. MessageDlg('Ввод первого номера телефона содержит только 3 числа', mtWarning, [mbOk], 0);

603. end;

604. procedure TFormRequisites.DBEditTelN2Click(Sender: TObject);

605. begin

606. if (Length(dbEditTelN2.Text)<3) then

607. MessageDlg Unit Table_Sobstvennikov('Ввод второго номера телефона содержит только 3 числа', mtWarning, [mbOk], 0);

608. end;

609. procedure TFormRequisites.DBEditTelN3Click(Sender: TObject);

610. begin

611. if (Length(dbEditTelN3.Text)<2) then

612. MessageDlg('Ввод третьего номера телефона содержит только 2 числа', mtWarning, [mbOk], 0);

613. end;

614. procedure TFormRequisites.DBEditTelN4Click(Sender: TObject);

615. begin

616. if (Length(dbEditTelN4.Text)<2) then

617. MessageDlg('Ввод четвёртого номера телефона содержит только 2 числа Unit Table_Sobstvennikov', mtWarning, [mbOk], 0);

618. end;

619. end.

Unit Export

621. function GetProgramPath : String;

622. begin

623. GetProgramPath:=ExtractFilePath(ParamStr(0));

624. end;

625. function GetPath:String;

626. begin

627. GetPath:=GetProgramPath+'shablon.doc';

628. end;

629. procedure TFormExport.ButtonExportClick(Sender: TObject);

630. var

631. DocName, FN, gp, Psw, PswTmp, Revert, WritePsw, WritePswTmp, Fmt, Index: OleVariant;

632. _Prod, Prod,ConfConv,ReadOnly,AddToRecFiles,replace, FalseParam: OleVariant;

633. TrueParam: OleVariant;

634. Wrap : OleVariant;

635. i1 : OleVariant; // Temporaly Unit Table_Sobstvennikov Var <-|

636. SP : OleVariant; // Save Prompt <-|

637. EP : OleVariant; // Empty param <-|

638. i : integer;

639. EmptyParam: OleVariant; // Пустой параметр

640. S,S1 : string;

641. begin

642. DocName:=GetProgramPath+'shablon.docx';

643. ConfConv:=true;

644. ReadOnly:=False;

645. AddToRecFiles:=False;

646. Psw:='';

647. PswTmp:='';

648. Revert:=false;

649. WritePsw:='False';

650. WritePswTmp:='False';

651. Fmt:=WdOpenFormatAuto;

652. FalseParam:=False;

653. TrueParam:=True;

654. Wrap:=WdFindContinue;

655. WordApplication1.Connect;

656. WordApplication Unit Table_Sobstvennikov1.Documents.OpenOld(DocName, ConfConv, ReadOnly, AddToRecFiles, Psw, PswTmp, Revert, WritePsw, WritePswTmp, Fmt);

657. WordDocument1.ConnectTo(WordApplication1.ActiveDocument);

658. Replace:=WdReplaceAll;

659. Index:=0;

660. FN:=InputBox('Сохранение','Введите название файла:','Квитанция.docx');

661. for i:=1 to WordApplication1.Documents.Count do

662. begin

663. i1:=i;

664. S:=FN;

665. if Pos('.',S)0 then

666. S:=Copy(S,1,Pos('.',S));

667. S:=S+'doc';

668. S1:=WordApplication1.Documents Unit Table_Sobstvennikov.Item(I1).Name;

669. S:=ExtractFileName(S);

670. S1:=ExtractFileName(S1); // если названия файлов схожи

671. if UpperCase(S1)=UpperCase(S) then // то файл запирается

672. begin

673. WordApplication1.Visible:=True;

674. SP:=wdPromptToSaveChanges;

675. EP:=wdOriginalDocumentFormat;

676. WordApplication1.Documents.Item(i1).Close(SP,EP,EP);

677. end;

678. end;

679. gp:=GetProgramPath+FN; // сохраняем шаблон под именованием new_1.doc

680. WordDocument1.SaveAs(gp);

681. GaugeSagruskaExporta Unit Table_Sobstvennikov.Progress:=GaugeSagruskaExporta.Progress+2;

682. _Prod:='dbeditINN';

683. Prod:=formrequisites.dbeditINN.Text;

684. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

685. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

686. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

687. _Prod:='dbeditRS';

688. Prod:=formrequisites.dbeditRS.Text;

689. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

690. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam Unit Table_Sobstvennikov, Prod, replace);

691. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

692. _Prod:='dbeditBIK';

693. Prod:=formrequisites.dbeditBIK.Text;

694. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

695. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

696. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

697. _Prod:='dbeditKS';

698. Prod:=formrequisites.dbeditKS.Text;

699. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

700. EmptyParam, EmptyParam, EmptyParam, EmptyParam Unit Table_Sobstvennikov, EmptyParam, Prod, replace);

701. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

702. _Prod:='datetimepicker1';

703. Prod:=DateToStr(Date);

704. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

705. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

706. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

707. _Prod:='dblookupcomboboxFIO';

708. Prod:=dblookupcomboboxFIO.Text;

709. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

710. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod Unit Table_Sobstvennikov, replace);

711. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

712. _Prod:='dblookupcomboboxadr';

713. Prod:=FormKvitanzia.dblookupcomboboxadr.Text;

714. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

715. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

716. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

717. _Prod:='dblookupcomboboxPL';

718. Prod:=dblookupcomboboxPL.Text;

719. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

720. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod Unit Table_Sobstvennikov, replace);

721. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

722. _Prod:='editnaimtsg';

723. Prod:=formrequisites.dbeditnaimtsg.Text;

724. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

725. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

726. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

727. _Prod:='dblookupcomboboxkolvo';

728. Prod:=dblookupcomboboxkolvo.Text;

729. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

730. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam Unit Table_Sobstvennikov, Prod, replace);

731. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+3;

732. _Prod:='editadr';

733. Prod:=formrequisites.dbeditadr.Text;

734. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

735. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

736. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+3;

737. _Prod:='maskedittel';

738. Prod:=formrequisites.dbedittel.text;

739. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

740. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam Unit Table_Sobstvennikov, Prod, replace);

741. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+3;

742. _Prod:='dblookupcomboboxkolvo';

743. Prod:=dblookupcomboboxkolvo.Text;

744. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

745. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

746. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+3;

747. _Prod:='dblookupcomboboxnaimvoda';

748. Prod:=FormKvitanzia.dblookupcomboboxnaimvoda.text;

749. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

750. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace Unit Table_Sobstvennikov);

751. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+3;

752. _Prod:='dblookupcomboboxnaimgiljo';

753. Prod:=FormKvitanzia.dblookupcomboboxnaimgiljo.text;

754. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

755. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

756. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+3;

757. _Prod:='dblookupcomboboxnaimotopl';

758. Prod:=FormKvitanzia.dblookupcomboboxnaimotopl.text;

759. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

760. EmptyParam, EmptyParam, EmptyParam, EmptyParam Unit Table_Sobstvennikov, EmptyParam, Prod, replace);

761. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+3;

762. _Prod:='dblookupcomboboxnaimsvet';

763. Prod:=FormKvitanzia.dblookupcomboboxnaimsvet.text;

764. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

765. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

766. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+3;

767. _Prod:='dblookupcomboboxnaimobslug';

768. Prod:=FormKvitanzia.dblookupcomboboxnaimobslug.text;

769. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

770. EmptyParam, EmptyParam, EmptyParam, EmptyParam Unit Table_Sobstvennikov, EmptyParam, Prod, replace);

771. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+3;

772. _Prod:='dblookupcomboboxedvoda';

773. Prod:=FormKvitanzia.dblookupcomboboxedvoda.text;

774. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

775. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

776. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+3;

777. _Prod:='dblookupcomboboxedgiljo';

778. Prod:=FormKvitanzia.dblookupcomboboxedgiljo.text;

779. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

780. EmptyParam, EmptyParam, EmptyParam, EmptyParam Unit Table_Sobstvennikov, EmptyParam, Prod, replace);

781. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+5;

782. _Prod:='dblookupcomboboxedotopl';

783. Prod:=FormKvitanzia.dblookupcomboboxedotopl.text;

784. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

785. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

786. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+5;

787. _Prod:='dblookupcomboboxedsvet';

788. Prod:=FormKvitanzia.dblookupcomboboxedsvet.text;

789. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam Unit Table_Sobstvennikov,

790. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

791. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+5;

792. _Prod:='dblookupcomboboxedobslug';

793. Prod:=FormKvitanzia.dblookupcomboboxedobslug.text;

794. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

795. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

796. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+5;

797. _Prod:='dblookupcomboboxvoda';

798. Prod:=FormKvitanzia.dblookupcomboboxvoda.Text;

799. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

800. EmptyParam, EmptyParam Unit Table_Sobstvennikov, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

801. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+5;

802. _Prod:='dblookupcomboboxgiljo';

803. Prod:=FormKvitanzia.dblookupcomboboxgiljo.Text;

804. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

805. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

806. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+5;

807. _Prod:='dblookupcomboboxotopl';

808. Prod:=FormKvitanzia.dblookupcomboboxotopl.Text;

809. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam Unit Table_Sobstvennikov, EmptyParam,

810. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

811. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+6;

812. _Prod:='dblookupcomboboxsvet';

813. Prod:=FormKvitanzia.dblookupcomboboxsvet.Text;

814. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

815. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

816. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+6;

817. _Prod:='dblookupcomboboxobslug';

818. Prod:=FormKvitanzia.dblookupcomboboxobslug.Text;

819. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam Unit Table_Sobstvennikov, EmptyParam, EmptyParam,

820. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

821. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+6;

822. _Prod:='dbeditkolvovoda';

823. Prod:=FormKvitanzia.dbeditkolvovoda.Text;

824. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

825. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

826. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+6;

827. _Prod:='dbeditkolvogiljo';

828. Prod:=FormKvitanzia.dbeditkolvogiljo.Text;

829. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam Unit Table_Sobstvennikov, EmptyParam,

830. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

831. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+6;

832. _Prod:='dbeditkolvootopl';

833. Prod:=FormKvitanzia.dbeditkolvootopl.Text;

834. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

835. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

836. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+6;

837. _Prod:='dbeditkolvosvet';

838. Prod:=FormKvitanzia.dbeditkolvosvet.Text;

839. WordDocument1.Range.Find.ExecuteOld(_Prod Unit Table_Sobstvennikov, EmptyParam, EmptyParam, EmptyParam,

840. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

841. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+6;

842. _Prod:='dbeditkolvoobslug';

843. Prod:=FormKvitanzia.dbeditkolvoobslug.Text;

844. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

845. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

846. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+5;

847. _Prod:='dbedititogvoda';

848. Prod:=FormKvitanzia.dbedititogvoda.Text;

849. WordDocument1.Range Unit Table_Sobstvennikov.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

850. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

851. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+4;

852. _Prod:='dbedititoggiljo';

853. Prod:=FormKvitanzia.dbedititoggiljo.Text;

854. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

855. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

856. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+3;

857. _Prod:='dbedititogotopl';

858. Prod:=FormKvitanzia.dbedititogotopl.Text;

859. WordDocument1.Range.Find Unit Table_Sobstvennikov.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

860. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

861. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+7;

862. _Prod:='dbedititogsvet';

863. Prod:=FormKvitanzia.dbedititogsvet.Text;

864. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

865. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

866. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+1;

867. _Prod:='dbedititogobslug';

868. Prod:=FormKvitanzia.dbedititogobslug.Text;

869. WordDocument Unit Table_Sobstvennikov1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

870. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

871. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

872. _Prod:='dblookupcomboboxnumber';

873. Prod:=FormKvitanzia.dblookupcomboboxnumber.Text;

874. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

875. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

876. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

877. _Prod:='dblookupcomboboxls';

878. Prod:=FormKvitanzia.dblookupcomboboxls.Text;

879. WordDocument1.Range Unit Table_Sobstvennikov.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

880. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

881. GaugeSagruskaExporta.Progress:=GaugeSagruskaExporta.Progress+2;

882. _Prod:='DBEditItogo';

883. Prod:=FormKvitanzia.DBEditItog.Text;

884. WordDocument1.Range.Find.ExecuteOld(_Prod, EmptyParam, EmptyParam, EmptyParam,

885. EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam, Prod, replace);

886. WordApplication1.Application.Visible:=True;

887. WordApplication1.Disconnect;

888. GaugeSagruskaExporta.Progress:=0;

889. FormExport.Hide; end Unit Table_Sobstvennikov; end.

Unit Module DFM

891. procedure TDataModuleDFM.ADOTableSobFilterRecord(DataSet: TDataSet;

892. var Accept: Boolean);

893. begin

894. s:=copy(DataSet['ФИО'],1,length(ed));

895. accept:=s=ed;

896. end;

897. end.

Unit O_programme

899. procedure TFormProgram.FormClose(Sender: TObject; var Action: TCloseAction);

900. begin

901. FormProgram.Hide;

902. end;

903. end.

Unit Version

905. procedure TFormVersion.FormClose(Sender: TObject;

906. var Action: TCloseAction);

907. begin

908. formversion.hide;

909. end;

910. end Unit Table_Sobstvennikov.

Unit Table_Sobstvennikov

912. procedure TFormTableSobstvennikov.ButtonInsertClick(Sender: TObject);

913. begin

914. DataModuleDFM.ADOTableSob.Append;

915. labelpoisk.Visible:=false;

916. editpoisk.Visible:=false;

917. buttonInsert.Enabled:=false;

918. buttonDelete.Enabled:=true;

919. buttonCancel.Enabled:=true;

920. buttonRedactor.Enabled:=false;

921. buttonSave.Enabled:=false;

922. buttonPrior.Enabled:=false;

923. buttonNext.Enabled:=false;

924. dbeditNumber.Enabled:=true;

925. dbeditadr.Enabled:=true;

926. dbeditFIO.Enabled:=true;

927. dbeditLS.Enabled Unit Table_Sobstvennikov:=true;

928. dbeditkolvo.Enabled:=true;

929. dbeditPl.Enabled:=true;

930. dbnavigatorsob.Enabled:=false;

931. end;

932. procedure TFormTableSobstvennikov.ButtonDeleteClick(Sender: TObject);

933. begin

934. DataModuleDFM.ADOTableSob.delete;

935. labelpoisk.Visible:=true;

936. editpoisk.Visible:=true;

937. buttonInsert.Enabled:=true;

938. buttonDelete.Enabled:=true;

939. buttonRedactor.Enabled:=true;

940. buttoncancel.Enabled:=false;

941. buttonSave.Enabled:=false;

942. buttonPrior.Enabled:=true;

943. buttonNext.Enabled:=true;

944. dbeditNumber.Enabled:=false;

945. dbeditadr Unit Table_Sobstvennikov.Enabled:=false;

946. dbeditFIO.Enabled:=false;

947. dbeditLS.Enabled:=false;

948. dbeditkolvo.Enabled:=false;

949. dbeditPl.Enabled:=false;

950. dbnavigatorsob.Enabled:=true;

951. end;

952. procedure TFormTableSobstvennikov.ButtonCancelClick(Sender: TObject);

953. begin

954. DataModuleDFM.ADOTableSob.Cancel;

955. labelpoisk.Visible:=true;

956. editpoisk.Visible:=true;

957. buttonCancel.Enabled:=false;

958. buttonDelete.Enabled:=true;

959. buttoninsert.Enabled:=true;

960. buttonredactor.Enabled:=true;

961. buttonSave.Enabled:=false;

962. buttonPrior.Enabled Unit Table_Sobstvennikov:=true;

963. buttonNext.Enabled:=true;

964. dbeditNumber.Enabled:=false;

965. dbeditadr.Enabled:=false;

966. dbeditFIO.Enabled:=false;

967. dbeditLS.Enabled:=false;

968. dbeditkolvo.Enabled:=false;

969. dbeditPl.Enabled:=false;

970. dbnavigatorsob.Enabled:=true;

971. end;

972. procedure TFormTableSobstvennikov.ButtonSaveClick(Sender: TObject);

973. begin

974. If DataModuleDFM.ADOTableSob.Modified then DataModuleDFM.ADOTableSob.Post;

975. labelpoisk.Visible:=true;

976. editpoisk.Visible:=true;

977. buttonsave.Enabled:=false Unit Table_Sobstvennikov;

978. buttonInsert.Enabled:=true;

979. buttonDelete.Enabled:=true;

980. buttonRedactor.Enabled:=true;

981. buttonCancel.Enabled:=false;

982. buttonPrior.Enabled:=true;

983. buttonNext.Enabled:=true;

984. dbeditNumber.Enabled:=false;

985. dbeditadr.Enabled:=false;

986. dbeditFIO.Enabled:=false;

987. dbeditLS.Enabled:=false;

988. dbeditkolvo.Enabled:=false;

989. dbeditPl.Enabled:=false;

990. dbnavigatorsob.Enabled:=true;

991. end;

992. procedure TFormTableSobstvennikov.DBEditNumberKeyPress(Sender: TObject; var Key: Char Unit Table_Sobstvennikov);

993. begin

994. case Key of

995. #8,#32,'0'..'9':;

996. else key:=chr(0); end;

997. if (Length(dbEditNumber.Text)>10) and (key#8) then key:=#0;

998. if not (Key in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

999. if not (Key in ['0'..'9', #8, DecimalSeparator]) then

1000. MessageDlg('Разрешен ввод только цифрами ', mtWarning, [mbOk], 0);

1001. end;

1002. procedure TFormTableSobstvennikov.DBEditLSKeyPress(Sender: TObject; var Key: Char);

1003. begin

1004. case Key of

1005. #8,#32,'0'..'9':;

1006. else key:=chr(0); end;

1007. if Unit Table_Sobstvennikov (Length(dbEditLS.Text)>10) and (key#8) then key:=#0;

1008. if not (Key in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

1009. if not (Key in ['0'..'9', #8, DecimalSeparator]) then

1010. MessageDlg('Разрешен ввод только цифрами ', mtWarning, [mbOk], 0);

1011. end;

1012. procedure TFormTableSobstvennikov.DBEditkolvoKeyPress(Sender: TObject; var Key: Char);

1013. begin

1014. case Key of

1015. #8,#32,'0'..'9':;

1016. else key:=chr(0); end;

1017. if (Length(dbEditkolvo.Text)>10) and (key#8) then key Unit Table_Sobstvennikov:=#0;

1018. if not (Key in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

1019. if not (Key in ['0'..'9', #8, DecimalSeparator]) then

1020. MessageDlg('Разрешен ввод только цифрами ', mtWarning, [mbOk], 0);

1021. end;

1022. procedure TFormTableSobstvennikov.DBEditPlKeyPress(Sender: TObject; var Key: Char);

1023. begin

1024. case Key of

1025. #8,#32,'0'..'9':;

1026. else key:=chr(0); end;

1027. if (Length(dbEditPl.Text)>10) and (key#8) then key:=#0;

1028. if not (Key in ['0'..'9', #8, DecimalSeparator]) then Key:=#0;

1029. if not Unit Table_Sobstvennikov (Key in ['0'..'9', #8, DecimalSeparator]) then

1030. MessageDlg('Разрешен ввод только цифрами ', mtWarning, [mbOk], 0);

1031. end;

1032. procedure TFormTableSobstvennikov.DBEditadrKeyPress(Sender: TObject; var Key: Char);

1033. begin

1034. if (Length(dbEditadr.Text)>100) and (key#8) then key:=#0;

1035. end;

1036. procedure TFormTableSobstvennikov.DBEditFIOKeyPress(Sender: TObject; var Key: Char);

1037. begin

1038. case Key of

1039. #8,#32,'А'..'Я','а'..'я','.':;

1040. else key:=chr(0); end Unit Table_Sobstvennikov;

1041. if (Length(dbEditFIO.Text)>50) and (key#8) then key:=#0;

1042. if not (Key in ['А'..'Я','а'..'я', '.', #8, #32, DecimalSeparator]) then Key:=#0;

1043. if not (Key in ['А'..'Я','а'..'я', '.', #8, #32, DecimalSeparator]) then

1044. MessageDlg('Разрешен ввод только русскими знаками и точками', mtWarning, [mbOk], 0);

1045. end;

1046. procedure TFormTableSobstvennikov.EditPoiskChange(Sender: TObject);

1047. begin

1048. if editpoisk.Visible=true then Unit Table_Sobstvennikov begin

1049. buttonsave.Enabled:=false;

1050. if EditPoisk.Text '' then begin

1051. DataModuleDFM.ADOTableSob.Filtered:=false;

1052. DataModuleDFM.ed:=editPoisk.Text;

1053. DataModuleDFM.ADOTableSob.Filtered:=true;

1054. end

1055. else

1056. if EditPoisk.Text = '' then

1057. DataModuleDFM.ADOTableSob.Filtered:=false;

1058. end;

1059. end;

1060. procedure TFormTableSobstvennikov.ButtonPriorClick(Sender: TObject);

1061. begin

1062. DataModuleDFM.ADOTableSob.Prior;

1063. buttonsave.Enabled:=false;

1064. end;

1065. procedure TFormTableSobstvennikov.ButtonNextClick(Sender: TObject);

1066. begin

1067. DataModuleDFM.ADOTableSob.next;

1068. buttonsave.Enabled:=false Unit Table_Sobstvennikov;

1069. end;

1070. procedure TFormTableSobstvennikov.ButtonRedactorClick(Sender: TObject);

1071. begin

1072. if (dbeditNumber.Text'') and (dbeditadr.Text'') and (dbeditFIO.Text'')

1073. and (dbeditLS.Text'') and (dbeditkolvo.Text'') and (dbeditPL.Text'') then

1074. buttonSave.Enabled:=true else buttonSave.Enabled:=false;

1075. labelpoisk.Visible:=false;

1076. editpoisk.Visible:=false;

1077. buttonInsert.Enabled:=false;

1078. buttonredactor.Enabled:=false;

1079. buttonDelete.Enabled:=true;

1080. buttonCancel.Enabled:=true Unit Table_Sobstvennikov;

1081. buttonPrior.Enabled:=false;

1082. buttonNext.Enabled:=false;

1083. dbeditNumber.Enabled:=true;

1084. dbeditadr.Enabled:=true;


universitetskaya-kniga-moskva-sankt-peterburg-1999-stranica-37.html
universitetskaya-kniga-moskva-sankt-peterburg-1999-stranica-5.html
universitetskie-issledovaniya-2012.html