Архитектура Аудит Военная наука Иностранные языки Медицина Металлургия Метрология Образование Политология Производство Психология Стандартизация Технологии |
Текст скрипта создания физической схемы БД на встроенном языке программы ERwin ⇐ ПредыдущаяСтр 4 из 4
Dim ERwinWorkspace As Workspace Dim ERwinDatabase As Database Dim ERwinTableDef As TableDef Dim ERwinQueryDef As QueryDef Dim ERwinIndex As Index Dim ERwinField As Field Dim ERwinRelation As Relation Set ERwinWorkspace = DBEngine.WorkSpaces(0) Set ERwinDatabase = ERwinWorkspace.OpenDatabase(" sERwinDatabase" ) ' CREATE TABLE Klient Set ERwinTableDef = ERwinDatabase.CreateTableDef(" Klient" ) Set ERwinField = ERwinTableDef.CreateField(" Ключ", DB_LONG) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" КодКлиента", DB_LONG) ERwinField.Required = True ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Фамилия", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Имя", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Отчество", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Адрес", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Телефон", DB_LONG) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Дата рождения", DB_DATETIME) ERwinTableDef.Fields.Append ERwinField ERwinDatabase.TableDefs.Append ERwinTableDef Set ERwinField = ERwinTableDef.Fields(" Счет" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Счет: " ) Set ERwinField = ERwinTableDef.Fields(" КодКлиента" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " КодКлиента: " ) Set ERwinField = ERwinTableDef.Fields(" Фамилия" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Фамилия: " ) Set ERwinField = ERwinTableDef.Fields(" Имя" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Имя: " ) Set ERwinField = ERwinTableDef.Fields(" Отчество" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Отчество: " ) Set ERwinField = ERwinTableDef.Fields(" Адрес" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Адрес: " ) Set ERwinField = ERwinTableDef.Fields(" Телефон" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Телефон: " ) Set ERwinField = ERwinTableDef.Fields(" Дата рождения" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Дата рождения: " ) ' CREATE INDEX XPKKlient Set ERwinTableDef = ERwinDatabase.TableDefs(" Klient" ) Set ERwinIndex = ERwinTableDef.CreateIndex(" XPKKlient" ) Set ERwinField = ERwinIndex.CreateField(" Счёт" ) ERwinIndex.Fields.Append ERwinField ERwinIndex.Primary = True ERwinTableDef.Indexes.Append ERwinIndex ' CREATE INDEX XAK1Klient Set ERwinTableDef = ERwinDatabase.TableDefs(" Klient" ) Set ERwinIndex = ERwinTableDef.CreateIndex(" XAK1Klient" ) Set ERwinField = ERwinIndex.CreateField(" Телефон" ) ERwinIndex.Fields.Append ERwinField ERwinIndex.Unique = True ERwinTableDef.Indexes.Append ERwinIndex ' CREATE TABLE Adres Set ERwinTableDef = ERwinDatabase.CreateTableDef(" Oplata" ) Set ERwinField = ERwinTableDef.CreateField(" Клиент", DB_LONG) ERwinField.Required = True ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Страна", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Область", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Индекс", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Город", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Улица", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" №Дома", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" №Квартиры", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField ERwinField.Required = True ERwinTableDef.Fields.Append ERwinField ERwinDatabase.TableDefs.Append ERwinTableDef Set ERwinField = ERwinTableDef.Fields(" Клиент" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Клиент: " ) Set ERwinField = ERwinTableDef.Fields(" Страна" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Страна: " ) Set ERwinField = ERwinTableDef.Fields(" Область" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Область: " ) Set ERwinField = ERwinTableDef.Fields(" Индекс" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Индекс" Set ERwinField = ERwinTableDef.Fields(" Город" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Город: " ) Set ERwinField = ERwinTableDef.Fields(" Улица" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Улица: " ) Set ERwinField = ERwinTableDef.Fields(" №Дома" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " №Дома: " ) Set ERwinField = ERwinTableDef.Fields(" №Квартиры" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " №Квартиры: " ) ' CREATE TABLE Oplata Set ERwinTableDef = ERwinDatabase.CreateTableDef(" Oplata" ) Set ERwinField = ERwinTableDef.CreateField(" Клиент", DB_LONG) ERwinField.Required = True ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" КодОплаты", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Дата", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Сумма", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Валюта", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Тип", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Примечание", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Курс", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField ERwinField.Required = True ERwinTableDef.Fields.Append ERwinField ERwinDatabase.TableDefs.Append ERwinTableDef Set ERwinField = ERwinTableDef.Fields(" Клиент" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Клиент: " ) Set ERwinField = ERwinTableDef.Fields(" КодОплаты" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " КодОплаты: " ) Set ERwinField = ERwinTableDef.Fields(" Дата" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Дата: " ) Set ERwinField = ERwinTableDef.Fields(" Сумма" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Сумма: " ) Set ERwinField = ERwinTableDef.Fields(" Валюта" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Валюта" Set ERwinField = ERwinTableDef.Fields(" Тип" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Тип: " ) Set ERwinField = ERwinTableDef.Fields(" Курс" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Курс: " ) ' CREATE TABLE Document Set ERwinTableDef = ERwinDatabase.CreateTableDef(" Document" ) Set ERwinField = ERwinTableDef.CreateField(" Клиент", DB_LONG) ERwinField.Required = True ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" №Документа", DB_LONG) ERwinField.Required = True Set ERwinField = ERwinTableDef.CreateField(" №Договора", DB_LONG) ERwinField.Required = True Set ERwinField = ERwinTableDef.CreateField(" Дата изготовления", DB_LONG) ERwinField.Required = True ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Наименование документа", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField ERwinDatabase.TableDefs.Append ERwinTableDef Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Дата изготовления: " ) Set ERwinField = ERwinTableDef.Fields(" №Документа" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " №Документа: " ) Set ERwinField = ERwinTableDef.Fields(" №Договора" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " №Договора: " ) Set ERwinField = ERwinTableDef.Fields(" Наименование" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Наименование: " ) ' CREATE INDEX XPKDocument Set ERwinTableDef = ERwinDatabase.TableDefs(" Document" ) Set ERwinIndex = ERwinTableDef.CreateIndex(" XPKDocument" ) Set ERwinField = ERwinIndex.CreateField(" Клиент" ) ERwinIndex.Fields.Append ERwinField ERwinIndex.Primary = True ERwinTableDef.Indexes.Append ERwinIndex ' CREATE INDEX XIE1Document Set ERwinTableDef = ERwinDatabase.TableDefs(" Document" ) Set ERwinIndex = ERwinTableDef.CreateIndex(" XIE1Document" ) ERwinIndex.Fields.Append ERwinField ERwinTableDef.Indexes.Append ERwinIndex ' CREATE TABLE Rabota Set ERwinTableDef = ERwinDatabase.CreateTableDef(" Rabota " ) Set ERwinField = ERwinTableDef.CreateField(" Клиент", DB_LONG) ERwinField.Required = True ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Наименование", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Цена", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField ERwinDatabase.TableDefs.Append ERwinTableDef Set ERwinField = ERwinTableDef.Fields(" Клиент" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Клиент: " ) Set ERwinField = ERwinTableDef.Fields(" Наименование" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Наименование: " ) Set ERwinField = ERwinTableDef.Fields(" Цена" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Цена: " ) ' CREATE INDEX XPK Rabota Set ERwinTableDef = ERwinDatabase.TableDefs(" Rabota " ) Set ERwinIndex = ERwinTableDef.CreateIndex(" XPK Rabota " ) Set ERwinField = ERwinIndex.CreateField(" Клиент" ) ERwinIndex.Fields.Append ERwinField ERwinIndex.Primary = True ERwinTableDef.Indexes.Append ERwinIndex ' CREATE TABLE Izdeliya Set ERwinTableDef = ERwinDatabase.CreateTableDef(" Izdeliya " ) Set ERwinField = ERwinTableDef.CreateField(" Клиент", DB_LONG) ERwinField.Required = True ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" №Изделия", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Количество", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Цена", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Эскиз", DB_DATETIME) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Длина", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Ширина", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Цвет", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Аксессуар", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField Set ERwinField = ERwinTableDef.CreateField(" Цена на аксессуар", DB_TEXT, 20) ERwinTableDef.Fields.Append ERwinField ERwinDatabase.TableDefs.Append ERwinTableDef Set ERwinField = ERwinTableDef.Fields(" Клиент" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Клиент: " ) Set ERwinField = ERwinTableDef.Fields(" №Изделия" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " №Изделия: " ) Set ERwinField = ERwinTableDef.Fields(" Количество" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Количество: " ) Set ERwinField = ERwinTableDef.Fields(" Цена" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Цена: " ) Set ERwinField = ERwinTableDef.Fields(" Эскиз" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Эскиз: " ) Set ERwinField = ERwinTableDef.Fields(" Площадь" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Площадь: " ) Set ERwinField = ERwinTableDef.Fields(" Длина" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Длина: " ) Set ERwinField = ERwinTableDef.Fields(" Ширина" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Ширина: " ) Set ERwinField = ERwinTableDef.Fields(" Цвет" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Цвет: " ) Set ERwinField = ERwinTableDef.Fields(" Аксессуар" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Аксессуар: " ) Set ERwinField = ERwinTableDef.Fields(" Цена на аксессуар" ) Call SetFieldProp(ERwinField, " Caption", DB_TEXT, " Цена на аксессуар: " ) ' CREATE INDEX XPKIzdeliya Set ERwinTableDef = ERwinDatabase.TableDefs(" Izdeliya" ) Set ERwinIndex = ERwinTableDef.CreateIndex(" XPKIzdeliya" ) Set ERwinField = ERwinIndex.CreateField(" Клиент" ) ERwinIndex.Fields.Append ERwinField ERwinIndex.Primary = True ERwinTableDef.Indexes.Append ERwinIndex ' CREATE RELATIONSHIP R/1 Set ERwinRelation = ERwinDatabase.CreateRelation(" R/1", " Klient", " Adres" ) Set ERwinField = ERwinRelation.CreateField " Клиент" ) ERwinField.ForeignName =Клиент ERwinRelation.Fields.Append ERwinField ERwinDatabase.Relations.Append ERwinRelation ' CREATE RELATIONSHIP R/2 Set ERwinRelation = ERwinDatabase.CreateRelation(" R/2", " Klient ", " Rabota" ) Set ERwinField = ERwinRelation.CreateField " Клиент" ) ERwinField.ForeignName = Клиент ERwinRelation.Fields.Append ERwinField ERwinDatabase.Relations.Append ERwinRelation ' CREATE RELATIONSHIP R/3 Set ERwinRelation = ERwinDatabase.CreateRelation(" R/3", " Klient ", " Document" ) Set ERwinField = ERwinRelation.CreateField " Клиент" ) ERwinField.ForeignName = Клиент ERwinRelation.Fields.Append ERwinField ERwinDatabase.Relations.Append ERwinRelation ' CREATE RELATIONSHIP R/4 Set ERwinRelation = ERwinDatabase.CreateRelation(" R/4", " Klient ", " Oplata" ) Set ERwinField = ERwinRelation.CreateField " Клиент" ) ERwinField.ForeignName = Клиент ERwinRelation.Fields.Append ERwinField ERwinDatabase.Relations.Append ERwinRelation ' CREATE RELATIONSHIP R/5 Set ERwinRelation = ERwinDatabase.CreateRelation(" R/5", " Klient ", " Izdeliya" ) Set ERwinField = ERwinRelation.CreateField " Клиент" ) ERwinField.ForeignName = Клиент ERwinDatabase.Relations.Append ERwinRelation ERwinDatabase.Close ERwinWorkspace.Close ' Terminating Access Basic DAO Sess Приложение 2 Листинг программы Создание главной формы unit Zakaz interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Grids, DBGrids, StdCtrls, Buttons, ExtCtrls, jpeg, DBCtrls; type TfZakaz = class(TForm) Panel1: TPanel; Panel2: TPanel; Panel3: TPanel; Splitter1: TSplitter; RadioButton1: TRadioButton; RadioButton2: TRadioButton; RadioButton3: TRadioButton; Edit1: TEdit; Label1: TLabel; BitBtn1: TBitBtn; BitBtn2: TBitBtn; BitBtn3: TBitBtn; DBGrid1: TDBGrid; DBGrid2: TDBGrid; Label3: TLabel; RadioButton4: TRadioButton; PrintDialog1: TPrintDialog; Image1: TImage; procedure BitBtn2Click(Sender: TObject); procedure BitBtn3Click(Sender: TObject); procedure RadioButton1Click(Sender: TObject); procedure RadioButton2Click(Sender: TObject); procedure RadioButton3Click(Sender: TObject); procedure BitBtn1Click(Sender: TObject); procedure RadioButton4Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var fZakaz: TfZakaz; implementation uses DM, Editor; {$R *.dfm} procedure TfZakaz.BitBtn2Click(Sender: TObject); begin fDM.TKlient.Append; fDM.TIzdeliya.Append; fDM.TAdres.Append; fEditor.ShowModal; end; procedure TfZakaz.BitBtn1Click(Sender: TObject); begin fDM.MyLocate(Edit1.Text); end; procedure TfZakaz.RadioButton1Click(Sender: TObject); begin if RadioButton1.Checked then DBGrid2.DataSource: = fDM.DSIzdeliya; end; procedure TfZakaz.RadioButton2Click(Sender: TObject); begin if RadioButton2.Checked then DBGrid2.DataSource: = fDM.DSDocument; end; procedure TfZakaz.RadioButton3Click(Sender: TObject); begin if RadioButton3.Checked then DBGrid2.DataSource: = fDM.DSRabota; end; procedure TfZakaz.BitBtn3Click(Sender: TObject); begin fEditor.ShowModal; end; procedure TfZakaz.RadioButton4Click(Sender: TObject); begin if RadioButton4.Checked then DBGrid2.DataSource: = fDM.DSOplata; end; end. procedure TfZakaz.N4Click(Sender: TObject); begin fRepIzdeliya.QuickRep1.PreviewModal; end; procedure TfZakaz.N3Click(Sender: TObject); begin Close; // Выход из программы end; {Отчет контакты } procedure TfZakaz.N5Click(Sender: TObject); begin fRepTelephons.QuickRep1.PreviewModal; end; end.
Создание формы Editor unit Editor; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, DBCtrls, Mask, ExtCtrls, Grids, DBGrids, jpeg; type TfEditor = class(TForm) GroupBox1: TGroupBox; GroupBox2: TGroupBox; GroupBox4: TGroupBox; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBEdit4: TDBEdit; DBEdit5: TDBEdit; DBEdit6: TDBEdit; DBEdit7: TDBEdit; DBEdit8: TDBEdit; DBComboBox1: TDBComboBox; DBComboBox2: TDBComboBox; DBEdit9: TDBEdit; DBEdit10: TDBEdit; BitBtn1: TBitBtn; DBEdit15: TDBEdit; DBComboBox3: TDBComboBox; DBEdit16: TDBEdit; DBGrid1: TDBGrid; BitBtn2: TBitBtn; BitBtn3: TBitBtn; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label9: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label13: TLabel; Label14: TLabel; Label15: TLabel; Label17: TLabel; Label18: TLabel; Label19: TLabel; Label20: TLabel; GroupBox5: TGroupBox; GroupBox6: TGroupBox; DBEdit19: TDBEdit; Label23: TLabel; DBEdit20: TDBEdit; DBEdit21: TDBEdit; DBEdit22: TDBEdit; Label24: TLabel; Label26: TLabel; DBEdit24: TDBEdit; DBEdit25: TDBEdit; DBEdit26: TDBEdit; Label27: TLabel; Label28: TLabel; Label29: TLabel; Label25: TLabel; Label30: TLabel; DBComboBox5: TDBComboBox; DBEdit18: TDBEdit; DBComboBox4: TDBComboBox; Label22: TLabel; DBEdit23: TDBEdit; Label31: TLabel; Image1: TImage; Image2: TImage; Image3: TImage; Image4: TImage; Image5: TImage; Image6: TImage; Image7: TImage; Label16: TLabel; Label32: TLabel; Label33: TLabel; Label34: TLabel; Label35: TLabel; Label36: TLabel; Label37: TLabel; Label38: TLabel; DBEdit11: TDBEdit; DBEdit27: TDBEdit; Label39: TLabel; Label40: TLabel; DBComboBox6: TDBComboBox; Label41: TLabel; DBEdit12: TDBEdit; Label6: TLabel; Label7: TLabel; DBEdit13: TDBEdit; DBNavigator1: TDBNavigator; GroupBox3: TGroupBox; Label1: TLabel; Label8: TLabel; DBEdit1: TDBEdit; DBComboBox7: TDBComboBox; procedure GroupBox1Exit(Sender: TObject); procedure GroupBox2Exit(Sender: TObject); procedure GroupBox3Exit(Sender: TObject); procedure GroupBox4Exit(Sender: TObject); procedure GroupBox5Exit(Sender: TObject); procedure BitBtn1Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); procedure BitBtn3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var fEditor: TfEditor; implementation uses DM; {$R *.dfm} procedure TfEditor.GroupBox1Exit(Sender: TObject); begin if fDM.TKlient.Modified then fDM.TKlient.Post; end; procedure TfEditor.GroupBox2Exit(Sender: TObject); begin if fDM.TAdres.Modified then fDM.TAdres.Post; end; procedure TfEditor.GroupBox3Exit(Sender: TObject); begin if fDM.TIzdeliya.Modified then fDM.TIzdeliya.Post; end; procedure TfEditor.GroupBox4Exit(Sender: TObject); begin if fDM.TOplata.Modified then fDM.TOplata.Post; end; procedure TfEditor.GroupBox5Exit(Sender: TObject); begin if fDM.TDocument.Modified then fDM.TDocument.Post; end; procedure TfEditor.BitBtn1Click(Sender: TObject); begin if fDM.TIzdeliya.Modified then fDM.TIzdeliya.Post; fDM.TIzdeliya.Append; DBEdit15.SetFocus; end; procedure TfEditor.BitBtn2Click(Sender: TObject); begin if fDM.TKlient.Modified then fDM.TKlient.Post; if fDM.TOplata.Modified then fDM.TOplata.Post; if fDM.TDocument.Modified then fDM.TDocument.Post; if fDM.TIzdeliya.Modified then fDM.TIzdeliya.Post; if fDM.TAdres.Modified then fDM.TAdres.Post; if fDM.TRabota.Modified then fDM.TRabota.Post; Close; end; procedure TfEditor.BitBtn3Click(Sender: TObject); begin fDM.TKlient.Append; fDM.TIzdeliya.Append; fDM.TAdres.Append; DBEdit1.SetFocus; end; end.
Популярное:
|
Последнее изменение этой страницы: 2017-03-03; Просмотров: 400; Нарушение авторского права страницы