отчет мубараков. Прогнозирование заказов такси с использованием данных заказов
Скачать 1.42 Mb.
|
ЛИСТИНГ программыunitMainForm; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ADODB, DB, Grids, DBGrids, ExtCtrls, DBCtrls, Calendar, ComCtrls, XPMan, StdCtrls, RpCon, RpConDS, RpDefine, RpRave, ExtDlgs, Buttons, Menus; type TForm1 = class(TForm) XPManifest1: TXPManifest; ADOConnection1: TADOConnection; SaveDialog1: TSaveDialog; BitBtn1: TBitBtn; BitBtn2: TBitBtn; BitBtn3: TBitBtn; BitBtn4: TBitBtn; BitBtn5: TBitBtn; BitBtn6: TBitBtn; MainMenu1: TMainMenu; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; N5: TMenuItem; N6: TMenuItem; N7: TMenuItem; N8: TMenuItem; N9: TMenuItem; N10: TMenuItem; N11: TMenuItem; N12: TMenuItem; N13: TMenuItem; N14: TMenuItem; N15: TMenuItem; procedure FormCreate(Sender: TObject); procedure ADOTable1DSDesigner3SetText(Sender: TField; const Text: String); procedure Button3Click(Sender: TObject); procedure Button4Click(Sender: TObject); procedure Button2Click(Sender: TObject); procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean); procedure BitBtn1Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); procedure BitBtn3Click(Sender: TObject); procedure BitBtn4Click(Sender: TObject); procedure BitBtn5Click(Sender: TObject); procedure BitBtn6Click(Sender: TObject); procedure N5Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure N11Click(Sender: TObject); procedure N12Click(Sender: TObject); procedure N14Click(Sender: TObject); procedure N7Click(Sender: TObject); procedure N8Click(Sender: TObject); procedure N9Click(Sender: TObject); procedure N10Click(Sender: TObject); procedure N15Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation uses uSotrudniki, uKlienti, uTovar, uRealizacia, uTip, uStats, uAsort, Wizard; {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); var Icon: TIcon; BMP: TBitmap; begin end; procedure TForm1.ADOTable1DSDesigner3SetText(Sender: TField; const Text: String); var a:integer; begin if text='' then beginSender.AsInteger := 1 ; exit; end; a:= Pos(':', text) ; if a<=0 then begin Sender.AsInteger := 1 ; exit; end else Sender.AsInteger:=StrToInt( Copy(text,1, a-1) ); end; procedure TForm1.Button3Click(Sender: TObject); begin form4.show; end; procedure TForm1.Button2Click(Sender: TObject); begin form5.show; end; procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean); // begin if MessageDlg('Закрытьпрограмму ? ', mtConfirmation, [mbOk, mbCancel], 0) = mrCancel then CanClose := False ; end; procedure TForm1.BitBtn1Click(Sender: TObject); begin form2.show; end; procedure TForm1.BitBtn2Click(Sender: TObject); begin form4.show; end; procedure TForm1.BitBtn3Click(Sender: TObject); begin form5.show; end; procedure TForm1.BitBtn4Click(Sender: TObject); begin form6.show; end; procedure TForm1.BitBtn5Click(Sender: TObject); begin form8.show; end; procedure TForm1.BitBtn6Click(Sender: TObject); begin close; end; procedure TForm1.N5Click(Sender: TObject); begin form4.show; end; procedure TForm1.N6Click(Sender: TObject); begin form2.show; end; procedure TForm1.N11Click(Sender: TObject); begin form9.show; end; procedure TForm1.N12Click(Sender: TObject); begin form6.show; end; procedure TForm1.N14Click(Sender: TObject); begin form5.show; end; procedure TForm1.N7Click(Sender: TObject); begin form5.Rvproject2.Execute; end; procedure TForm1.N8Click(Sender: TObject); begin form4.show; Form4.BitBtn1Click(Sender); end; procedure TForm1.N9Click(Sender: TObject); begin form2.show; Form2.BitBtn1Click(Sender); end; procedure TForm1.N10Click(Sender: TObject); begin form6.show; Form6.BitBtn2Click(Sender); end; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, DBCtrls, ExtCtrls, DB, ADODB, Grids, DBGrids, Mask, ExtDlgs, OleServer, ExcelXP, Menus, ComCtrls,ComObj, RpRave, RpDefine, RpCon, RpConDS, Buttons, DBAdvNavigator; type TForm2 = class(TForm) Label1: TLabel; Label2: TLabel; ADOTable1: TADOTable; DataSource1: TDataSource; ADOTable2: TADOTable; DataSource2: TDataSource; OpenPictureDialog1: TOpenPictureDialog; MainMenu1: TMainMenu; N1: TMenuItem; N2: TMenuItem; N3: TMenuItem; N4: TMenuItem; GroupBox4: TGroupBox; ADOTable1DSDesigner: TAutoIncField; ADOTable1DSDesigner2: TWideStringField; ADOTable1DSDesigner3: TWideStringField; ADOTable1DSDesigner4: TWideStringField; ADOTable1DSDesigner5: TWideStringField; ADOTable1DSDesigner6: TWideStringField; ADOTable1DSDesigner7: TWideStringField; ADOTable1DSDesigner8: TWideStringField; ADOTable1DSDesigner9: TBlobField; ADOTable1DSDesigner10: TWideStringField; ADOTable1DSDesigner11: TIntegerField; ADOTable1DSDesigner12: TWideStringField; ADOTable1DSDesigner13: TWideStringField; ADOTable1DSDesigner14: TWideStringField; ADOTable1DSDesigner15: TWideStringField; ADOTable1DSDesigner16: TDateTimeField; ADOTable1DSDesigner17: TWideStringField; GroupBox6: TGroupBox; DBGrid1: TDBGrid; GroupBox1: TGroupBox; DBImage1: TDBImage; btFoto: TButton; PageControl1: TPageControl; TabSheet1: TTabSheet; Label3: TLabel; DBEdit1: TDBEdit; DBEdit3: TDBEdit; Label4: TLabel; Label5: TLabel; DBEdit2: TDBEdit; TabSheet3: TTabSheet; Label6: TLabel; DBLookupComboBox1: TDBLookupComboBox; Label7: TLabel; Label8: TLabel; TabSheet4: TTabSheet; MonthCalendar1: TMonthCalendar; Button1: TButton; DBEdit4: TDBEdit; Label9: TLabel; Label10: TLabel; DBEdit5: TDBEdit; DBEdit6: TDBEdit; Label11: TLabel; Label12: TLabel; DBEdit7: TDBEdit; Label13: TLabel; DBEdit9: TDBEdit; DBEdit10: TDBEdit; Label14: TLabel; Label15: TLabel; DBEdit11: TDBEdit; Label16: TLabel; Label17: TLabel; DBComboBox1: TDBComboBox; N5: TMenuItem; ADOTable2DSDesigner: TAutoIncField; ADOTable2DSDesigner2: TWideStringField; ADOTable2DSDesigner3: TWideStringField; ADOTable2DSDesigner4: TIntegerField; ADOTable2DSDesigner5: TIntegerField; ADOTable2DSDesigner6: TMemoField; ADOTable1DSDesigner18: TWideStringField; Label18: TLabel; DBEdit8: TDBEdit; RvDataSetConnection2: TRvDataSetConnection; RvProject1: TRvProject; BitBtn1: TBitBtn; Image1: TImage; Image2: TImage; BitBtn2: TBitBtn; DBAdvNavigator1: TDBAdvNavigator; Label19: TLabel; DBEdit12: TDBEdit; N7: TMenuItem; N6: TMenuItem; N8: TMenuItem; procedure btFotoClick(Sender: TObject); procedure Button1Click(Sender: TObject); procedure N3Click(Sender: TObject); procedure N4Click(Sender: TObject); procedure MonthCalendar1Click(Sender: TObject); procedure N5Click(Sender: TObject); procedure BitBtn1Click(Sender: TObject); procedure BitBtn2Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure N7Click(Sender: TObject); procedure N8Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation uses uDolgnosti, MainForm; {$R *.dfm} procedure TForm2.btFotoClick(Sender: TObject); begin if OpenPictureDialog1.Execute then begin DBImage1.Picture.LoadFromFile(OpenPictureDialog1.FileName); ADOtable1.Edit; TBLOBField(ADOtable1.FieldByName('Фотография')).LoadFromFile(OpenPictu reDialog1.FileName); ADOtable1.Post; end; end; procedure TForm2.Button1Click(Sender: TObject); begin form3.show; end; procedure TForm2.N3Click(Sender: TObject); begin form3.Show; end; procedure TForm2.N4Click(Sender: TObject); begin btFotoClick(Sender); end; procedure TForm2.MonthCalendar1Click(Sender: TObject); begin DBGrid1.EditorMode:=true; ADOTable1DSDesigner5.DataSet.Edit; ADOTable1DSDesigner5.Text :=DateToStr(MonthCalendar1.Date); end; procedure TForm2.N5Click(Sender: TObject); begin pagecontrol1.ActivePageIndex:=1; DBLookupComboBox1.SetFocus; end; procedure TForm2.BitBtn1Click(Sender: TObject); var Excel: Variant; WorkbookName: string; begin WorkbookName := GetCurrentDir + '\Шаблоны\' + 'Личнаякарточка.xlt'; Excel := CreateOleObject('Excel.Application'); try Excel.Workbooks.Open(WorkbookName); Excel.Cells[8,2] := 'ОООФИРМА'; Excel.Cells[13,3] := ADOTable1DSDesigner.AsString; Excel.Cells[13,4] := DBEdit4.Text; Excel.Cells[13,5] := DBEdit7.Text; Excel.Cells[13,9] := DBComboBox1.Text; Excel.Cells[19,9] :=ADOTable1DSDesigner5.AsString; Excel.Cells[18,9] :=ADOTable1DSDesigner.AsString+'00'; Excel.Cells[20,3]:= DBEdit1.Text; Excel.Cells[20,6]:=DBEdit2.Text; Excel.Cells[18,9]:= DBEdit2.Text; Excel.Cells[21,4]:= DBEdit6.Text; Excel.Cells[23,4]:= DBEdit5.Text; Excel.Cells[26,4]:= DBEdit8.Text; Excel.Cells[29,4]:= DBLookupComboBox1.Text; Excel.Visible := True; except Excel.Quit; end; end; procedure TForm2.BitBtn2Click(Sender: TObject); begin RvProject1.Execute end; procedure TForm2.N6Click(Sender: TObject); begin BitBtn1Click(Sender); end; procedure TForm2.N7Click(Sender: TObject); begin RvProject1.Execute; end; procedure TForm2.N8Click(Sender: TObject); begin hide; end; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, DBCtrls, Mask, Grids, DBGrids, ExtCtrls, ComCtrls, DBAdvNavigator, Buttons; type TForm3 = class(TForm) DBGrid1: TDBGrid; GroupBox2: TGroupBox; Label1: TLabel; Label2: TLabel; Label6: TLabel; DBEdit4: TDBEdit; DBEdit5: TDBEdit; DBEdit6: TDBEdit; Label3: TLabel; Label4: TLabel; Label5: TLabel; PageControl1: TPageControl; TabSheet1: TTabSheet; TabSheet2: TTabSheet; GroupBox3: TGroupBox; DBMemo2: TDBMemo; GroupBox1: TGroupBox; DBMemo1: TDBMemo; DBAdvNavigator1: TDBAdvNavigator; BitBtn1: TBitBtn; procedure BitBtn1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; |