Автоматизация складского учета на предприятии. Альборов, ВКР для Ахматовой 2. 1. 1 Анализ источников по теме работы
Скачать 0.71 Mb.
|
ПРИЛОЖЕНИЕ А Листинг программы unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DBCtrls, Grids, DBGrids, ExtCtrls, DB, DBTables, Menus, StdCtrls, Mask, ComCtrls, Buttons, RpRave, RpDefine, RpCon, RpConDS, RpBase, RpSystem; type TForm1 = class(TForm) MainMenu1: TMainMenu; N4: TMenuItem; DataSource1: TDataSource; DataSource2: TDataSource; DataSource3: TDataSource; DataSource4: TDataSource; DataSource5: TDataSource; Table1: TTable; Table2: TTable; Table3: TTable; Table4: TTable; Table5: TTable; PageControl1: TPageControl; TabSheet1: TTabSheet; Panel3: TPanel; Label7: TLabel; DBGrid3: TDBGrid; DBNavigator2: TDBNavigator; Button17: TButton; Edit3: TEdit; Button18: TButton; Button19: TButton; TabSheet2: TTabSheet; Panel4: TPanel; Label8: TLabel; Label9: TLabel; Label10: TLabel; Label11: TLabel; Label12: TLabel; DBGrid4: TDBGrid; DBEdit4: TDBEdit; DBEdit6: TDBEdit; DBEdit7: TDBEdit; DBEdit8: TDBEdit; Button21: TButton; Button22: TButton; Button23: TButton; Button25: TButton; DBMemo2: TDBMemo; TabSheet3: TTabSheet; TabSheet4: TTabSheet; Panel1: TPanel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; DBEdit1: TDBEdit; DBComboBox1: TDBComboBox; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBMemo1: TDBMemo; BitBtn1: TBitBtn; DBGrid1: TDBGrid; DBEdit5: TDBEdit; DBEdit9: TDBEdit; Label1: TLabel; Label13: TLabel; Label14: TLabel; DBEdit10: TDBEdit; DBMemo3: TDBMemo; Label15: TLabel; Butto1: TButton; N1: TMenuItem; Edit1: TEdit; Button1: TButton; dob: TButton; DBEdit11: TDBEdit; DBEdit12: TDBEdit; DBEdit13: TDBEdit; DBEdit14: TDBEdit; DBEdit16: TDBEdit; DBEdit17: TDBEdit; Dooformit: TButton; Soh: TButton; Label16: TLabel; Label17: TLabel; Label18: TLabel; Label19: TLabel; Label20: TLabel; Label21: TLabel; DBGrid2: TDBGrid; RvDataSetConnection1: TRvDataSetConnection; RvProject1: TRvProject; Pechat: TButton; Button2: TButton; Button3: TButton; Button4: TButton; Label22: TLabel; DBNavigator1: TDBNavigator; Table5Ng: TFloatField; Table5Name: TStringField; Table5Kol: TFloatField; Table5Cena: TCurrencyField; Table5Sum: TCurrencyField; DBNavigator3: TDBNavigator; DBNavigator4: TDBNavigator; Table1Name: TStringField; Table1Typ: TStringField; Table1Naz: TMemoField; Table1Cena: TCurrencyField; Table1Kol: TFloatField; Table2Ng: TAutoIncField; Table2Spisok: TMemoField; Table2Sum: TCurrencyField; Table2Date: TDateField; Table2Pred: TStringField; Table3Org: TStringField; Table3Pred: TStringField; Table3Adr: TStringField; Table3Tel: TMemoField; Table3Email: TStringField; Table4Ng: TFloatField; Table4Otv: TStringField; Table4DateOt: TDateField; Table4DateDos: TDateField; Table4Pred: TStringField; Table4Adr: TStringField; RvDataSetConnection2: TRvDataSetConnection; RvProject2: TRvProject; RvDataSetConnection3: TRvDataSetConnection; RvDataSetConnection4: TRvDataSetConnection; RvDataSetConnection5: TRvDataSetConnection; RvProject3: TRvProject; platr: TButton; soprov: TButton; dogov: TButton; RvProject4: TRvProject; RvSystem1: TRvSystem; RvSystem2: TRvSystem; RvSystem3: TRvSystem; RvSystem4: TRvSystem; procedure of_zakClick(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure N4Click(Sender: TObject); procedure Edit1Change(Sender: TObject); procedure platClick(Sender: TObject); procedure Button6Click(Sender: TObject); procedure Button7Click(Sender: TObject); procedure Button8Click(Sender: TObject); procedure Button9Click(Sender: TObject); procedure Button12Click(Sender: TObject); procedure Button10Click(Sender: TObject); procedure zakClick(Sender: TObject); procedure Buttonn1Click(Sender: TObject); procedure Butto1Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); procedure BitBtn1Click(Sender: TObject); procedure BitBtn3Click(Sender: TObject); procedure N1Click(Sender: TObject); procedure Button17Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure dobClick(Sender: TObject); procedure DooformitClick(Sender: TObject); procedure SohClick(Sender: TObject); procedure PechatClick(Sender: TObject); procedure platrClick(Sender: TObject); procedure soprovClick(Sender: TObject); procedure dogovClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses Unit2, Unit3, Unit5; {$R *.dfm} procedure TForm1.of_zakClick(Sender: TObject); begin panel1.Visible:=true; table1.Append; end; procedure TForm1.Button2Click(Sender: TObject); begin panel1.Visible:=true; table1.Edit; end; procedure TForm1.Button3Click(Sender: TObject); begin if Application.MessageBox(' Вы уверены, что хотите удалить данную запись ? ','Сообщение !!!',mb_IconQuestion+mb_yesno)= idYes then Form1.Table1.Delete; end; procedure TForm1.N4Click(Sender: TObject); begin close; application.Terminate; end; procedure TForm1.Edit1Change(Sender: TObject); begin table1.IndexFieldNames:='name'; table1.FindNearest([edit3.Text]); end; procedure TForm1.platClick(Sender: TObject); begin table1.IndexFieldNames:='typ;name'; end; procedure TForm1.Button6Click(Sender: TObject); begin if table1.Filtered then table1.Filtered:=false; form3.ShowModal; table1.Filtered:=true; table1.Filter:='typ='''+form3.comboBox1.text+ ''''; end; procedure TForm1.Button7Click(Sender: TObject); begin Panel1.Visible:=true; end; procedure TForm1.Button8Click(Sender: TObject); begin table3.Append; end; procedure TForm1.Button9Click(Sender: TObject); begin table3.Edit; end; procedure TForm1.Button12Click(Sender: TObject); begin table3.Post; end; procedure TForm1.Button10Click(Sender: TObject); begin if Application.MessageBox(' Вы уверены, что хотите удалить данную запись ? ','Сообщение !!!',mb_IconQuestion+mb_yesno)= idYes then Form1.Table3.Delete; end; procedure TForm1.zakClick(Sender: TObject); begin panel1.Visible:=false; end; procedure TForm1.Buttonn1Click(Sender: TObject); begin table2.First; table2.Append; dbedit9.Text:=dbedit6.Text; table2.Post; table2.Edit; end; procedure TForm1.Butto1Click(Sender: TObject); begin table5.Append; form5.DBEdit1.Text:=table2.FieldValues['ng']; table5.FieldValues['name']:=table1.FieldValues['name']; table5.FieldValues['cena']:=table1.FieldValues['cena']; table5.FieldValues['kol']:=strtoint(edit1.Text); form5.show; table5.Post; table1.Edit; table1.FieldValues['kol']:=table1.FieldValues['kol']-strtoint(edit1.Text); table1.Post; end; procedure TForm1.BitBtn2Click(Sender: TObject); begin form1.Table1.Next; end; procedure TForm1.BitBtn1Click(Sender: TObject); begin form1.Table1.Post; end; procedure TForm1.BitBtn3Click(Sender: TObject); begin form1.Table1.Prior; end; procedure TForm1.N1Click(Sender: TObject); begin table5.First; while not table5.Eof do table5.Delete; table2.Append; table2.Post; end; procedure TForm1.Button17Click(Sender: TObject); begin table1.Filtered:=false; end; procedure TForm1.Button1Click(Sender: TObject); begin table2.post; end; procedure TForm1.dobClick(Sender: TObject); begin table2.Edit; table2.FieldValues['pred']:=table3.FieldValues['pred']; table4.Append; table4.FieldValues['pred']:=table3.FieldValues['pred']; table4.FieldValues['adr']:=table3.FieldValues['adr']; table4.FieldValues['ng']:=table2.FieldValues['ng']; table4.Post; end; procedure TForm1.DooformitClick(Sender: TObject); begin table4.Edit; end; procedure TForm1.SohClick(Sender: TObject); begin table4.Post; end; procedure TForm1.PechatClick(Sender: TObject); begin form1.RvSystem1.DoNativeOutput := False; form1.RvSystem1.DefaultDest := rdPreview; form1.RvSystem1.SystemSetups := form1.RvSystem1.SystemSetups - [ssAllowSetup]; form1.RvProject1.Execute; end; procedure TForm1.platrClick(Sender: TObject); begin form1.RvSystem2.DoNativeOutput := False; form1.RvSystem2.DefaultDest := rdPreview; form1.RvSystem2.SystemSetups := form1.RvSystem1.SystemSetups - [ssAllowSetup]; form1.RvProject2.Execute; end; procedure TForm1.soprovClick(Sender: TObject); begin form1.RvSystem3.DoNativeOutput := False; form1.RvSystem3.DefaultDest := rdPreview; form1.RvSystem3.SystemSetups := form1.RvSystem1.SystemSetups - [ssAllowSetup]; form1.RvProject3.Execute; end; procedure TForm1.dogovClick(Sender: TObject); begin form1.RvSystem4.DoNativeOutput := False; form1.RvSystem4.DefaultDest := rdPreview; form1.RvSystem4.SystemSetups := form1.RvSystem1.SystemSetups - [ssAllowSetup]; form1.RvProject4.Execute; //rvproject4.Execute; end; end. unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, DBCtrls, Mask; type TForm2 = class(TForm) Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; DBEdit1: TDBEdit; DBComboBox1: TDBComboBox; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBMemo1: TDBMemo; BitBtn1: TBitBtn; BitBtn2: TBitBtn; Button1: TButton; Button2: TButton; Button3: TButton; BitBtn3: TBitBtn; procedure BitBtn1Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); procedure BitBtn3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation uses Unit1; {$R *.dfm} procedure TForm2.BitBtn1Click(Sender: TObject); begin form1.table1.post; end; procedure TForm2.BitBtn2Click(Sender: TObject); begin if not form1.Table1.Eof then form1.Table1.Next; end; procedure TForm2.Button1Click(Sender: TObject); begin form1.Table1.Edit; end; procedure TForm2.Button2Click(Sender: TObject); begin form1.Table1.Append; end; procedure TForm2.Button3Click(Sender: TObject); begin form2.Hide; end; procedure TForm2.BitBtn3Click(Sender: TObject); begin if not form1.Table1.Bof then form1.Table1.Prior; end; end. unit Unit3; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm3 = class(TForm) ComboBox1: TComboBox; Label1: TLabel; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form3: TForm3; implementation {$R *.dfm} procedure TForm3.Button1Click(Sender: TObject); begin form3.close; end; end. unit Unit4; interface uses SysUtils, Classes; type TDataModule4 = class(TDataModule) private { Private declarations } public { Public declarations } end; var DataModule4: TDataModule4; implementation {$R *.dfm} end. unit Unit5; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Mask, DBCtrls, Grids, DBGrids; type TForm5 = class(TForm) DBEdit1: TDBEdit; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBEdit4: TDBEdit; Button3: TButton; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; DBGrid1: TDBGrid; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure Button3Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form5: TForm5; implementation uses Unit1; {$R *.dfm} procedure TForm5.Button1Click(Sender: TObject); begin form1.table5.post; end; procedure TForm5.Button2Click(Sender: TObject); begin form1.table5.append; form5.DBEdit1.Text:=form1.table2.FieldValues['ng']; end; procedure TForm5.Button3Click(Sender: TObject); var s:real;i:integer; begin i:=0; form1.Table5.First; form1.DBMemo3.Clear; form1.Table2.Last; form1.Table2.Edit; while not form1.Table5.Eof do begin s:=s+form1.table5.FieldValues['cena']*form1.table5.FieldValues['kol']; i:=i+1; form1.DBMemo3.Lines.Add(form1.Table5.FieldValues['name']); form1.DBMemo3.Lines.Add(form1.Table5.FieldValues['kol']); form1.Table5.Next; end; form1.Table5.Edit; form1.table5.FieldValues['sum']:=s; form1.table5.Post; form1.Table2.FieldValues['sum']:=s; form1.table2.FieldValues['spisok']:= form1.DBMemo3.Text; form1.Table2.Post; end; end. |