Unit13 in 'Unit13.pas' {Form13}, Unit11 in 'Unit11.pas' {Form11}, Unit16 in 'Unit16.pas' {Form16}, Unit8 in 'Unit8.pas' {Form8}, Unit9 in 'Unit9.pas' {Form9}, Unit5 in 'Unit5.pas' {Form5}, Unit15 in 'Unit15.pas' {Form15}, Unit17 in 'Unit17.pas' {Form17}, Unit18 in 'Unit18.pas' {Form18}, Unit19 in 'Unit19.pas' {Form19}, Unit20 in 'Unit20.pas' {Form20}, Unit21 in 'Unit21.pas' {Form21}, Unit22 in 'Unit22.pas' {Form22}, Unit10 in 'Unit10.pas' {Form10}, Unit14 in 'Unit14.pas' {Form14}; {$R *.res} begin Application.Initialize; Application.Title:= 'УралСтройМонтаж'; Application.CreateForm(TForm1, Form1); Application.CreateForm(TForm2, Form2); Application.CreateForm(TForm3, Form3); Application.CreateForm(TForm4, Form4); Application.CreateForm(TForm6, Form6); Application.CreateForm(TForm7, Form7); Application.CreateForm(TForm12, Form12); Application.CreateForm(TForm13, Form13); Application.CreateForm(TForm11, Form11); Application.CreateForm(TForm16, Form16); Application.CreateForm(TForm8, Form8); Application.CreateForm(TForm9, Form9); Application.CreateForm(TForm5, Form5); Application.CreateForm(TForm15, Form15); Application.CreateForm(TForm17, Form17); Application.CreateForm(TForm18, Form18); Application.CreateForm(TForm19, Form19); Application.CreateForm(TForm20, Form20); Application.CreateForm(TForm21, Form21); Application.CreateForm(TForm22, Form22); Application.CreateForm(TForm10, Form10); Application.CreateForm(TForm14, Form14); Application.Run; end. unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, Menus, ExtCtrls, StdCtrls, XPMan, ComCtrls, Unit9, Mask,Buttons, jpeg ,Unit11, syncobjs,ImgList; type TForm1 = class(TForm) MainMenu1: TMainMenu; N1: TMenuItem;N2: TMenuItem; N19: TMenuItem;N18: TMenuItem; N4: TMenuItem;N3: TMenuItem; N5: TMenuItem;N6: TMenuItem; N7: TMenuItem;N8: TMenuItem; N9: TMenuItem;N10: TMenuItem; N12: TMenuItem;N13: TMenuItem; N15: TMenuItem;N16: TMenuItem; N17: TMenuItem;Panel1: TPanel; Label4: TLabel; Label1: TLabel; Edit1: TEdit; Label2: TLabel;Edit2: TEdit; Label3:TLabel;Label6:TLabel; SaveDialog1: TSaveDialog; OpenDialog1: TOpenDialog; PrintDialog1: TPrintDialog; XPManifest1: TXPManifest; Memo1: TMemo; N20: TMenuItem; ControlBar1: TControlBar; FontDialog1: TFontDialog; SpeedButton4: TSpeedButton; SpeedButton1: TSpeedButton; SpeedButton2: TSpeedButton; SpeedButton3: TSpeedButton; SpeedButton5: TSpeedButton; SpeedButton6: TSpeedButton; SpeedButton7: TSpeedButton; SpeedButton8: TSpeedButton; SpeedButton9: TSpeedButton; DateTimePicker1: TDateTimePicker;Timer1: TTimer;N11: TMenuItem; Image1: TImage; Image2: TImage;Label9: TLabel;SpeedButton13: TSpeedButton; SpeedButton14: TSpeedButton;Label8: TLabel; MaskEdit3: TMaskEdit; Label7: TLabel; MaskEdit2: TMaskEdit;Label10: TLabel; Label5: TLabel; Label12: TLabel; Memo4: TMemo; Timer2: TTimer; RichEdit1: TRichEdit; SpeedButton11: TSpeedButton; Label11: TLabel; N14: TMenuItem; procedure N5Click(Sender: TObject); procedure N16Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N7Click(Sender: TObject); procedure N9Click(Sender: TObject); procedure N10Click(Sender: TObject); procedure N3Click(Sender: TObject); procedure N18Click(Sender: TObject); procedure N19Click(Sender: TObject); procedure N11Click(Sender: TObject); procedure N13Click(Sender: TObject); procedure N2Click(Sender: TObject); procedure SpeedButton3Click(Sender: TObject); procedure SpeedButton1Click(Sender: TObject); procedure SpeedButton4Click(Sender: TObject); procedure SpeedButton7Click(Sender: TObject); procedure SpeedButton6Click(Sender: TObject); procedure SpeedButton5Click(Sender: TObject); procedure SpeedButton2Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure SpeedButton11Click(Sender: TObject); procedure N20Click(Sender: TObject); procedure FormCreate(Sender: TObject); procedure SpeedButton13Click(Sender: TObject); procedure SpeedButton9Click(Sender: TObject); procedure Edit1KeyPress(Sender: TObject; var Key: Char); procedure Edit2KeyPress(Sender: TObject; var Key: Char); procedure SpeedButton8Click(Sender: TObject); procedure SpeedButton14Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var CheckEvent: TEvent; Form1: TForm1; dir:string; kolok:integer; prof,spak,mon,got:string;fiozam,fiozak,adres,data,itog,domtel,sottel:string; implementation uses Unit2, Unit3, Unit4, Unit5, Unit6, Unit7, Unit8, Unit10, Unit12, Unit15; {$R *.dfm} procedure TForm1.N5Click(Sender: TObject); begin form2.Showmodal end; procedure TForm1.N16Click(Sender: TObject); begin form3.Showmodal end; procedure TForm1.N17Click(Sender: TObject); begin form4.Showmodal end; procedure TForm1.N7Click(Sender: TObject); var dlg:Word; begin dlg:=MessageDlg('Вы точно хотите выйти???',mtConfirmation,mbYesNoCancel,0); if dlg = mrYes then close; end; procedure TForm1.N9Click(Sender: TObject); begin form6.Showmodal; end; procedure TForm1.N10Click(Sender: TObject); begin form7.Showmodal; end; procedure TForm1.N3Click(Sender: TObject); begin Form1.PrintDialog1.Execute; end; procedure TForm1.N18Click(Sender: TObject); begin if Form1.SaveDialog1.Execute then RichEdit1.Lines.SaveToFile(SaveDialog1.FileName); end; procedure TForm1.N19Click(Sender: TObject); begin if form1.OpenDialog1.Execute then RichEdit1.Lines.LoadFromFile(OpenDialog1.FileName); end; procedure TForm1.N11Click(Sender: TObject); begin form9.Showmodal; end; procedure TForm1.N13Click(Sender: TObject); begin form12.Showmodal; end; procedure TForm1.N2Click(Sender: TObject); begin form11.Show; end; procedure TForm1.SpeedButton3Click(Sender: TObject); begin RichEdit1.Paragraph.Alignment:=taLeftJustify; end; procedure TForm1.SpeedButton1Click(Sender: TObject); begin RichEdit1.Paragraph.Alignment:=taRightJustify; end; procedure TForm1.SpeedButton4Click(Sender: TObject); begin if FontDialog1.Execute then RichEdit1.SelAttributes.Assign(FontDialog1.Font); RichEdit1.SetFocus; end; procedure TForm1.SpeedButton7Click(Sender: TObject); begin if Form1.SaveDialog1.Execute then RichEdit1.Lines.SaveToFile(SaveDialog1.FileName); end; procedure TForm1.SpeedButton6Click(Sender: TObject); begin if form1.OpenDialog1.Execute then RichEdit1.Lines.LoadFromFile(OpenDialog1.FileName); end; procedure TForm1.SpeedButton5Click(Sender: TObject); var f: Integer; begin for f := 0 to ComponentCount - 1 do begin if (Components[f] is TEdit) then (Components[f] as TEdit).Text := ''; if (Components[f] is TMaskEdit) then (Components[f] as TMaskEdit).Text := ''; if (Components[f] is TMemo) then (Components[f] as TMemo).Text := '';end; RichEdit1.Clear; prof:='';spak:='';mon:='';got:=''; got:='';adres:='';fiozam:='';fiozak:=''; Showmessage('Введите все данные по заказу!'); end; procedure TForm1.SpeedButton2Click(Sender: TObject); begin RichEdit1.Paragraph.Alignment:=taCenter;end; procedure TForm1.Timer1Timer(Sender: TObject); begin Label5.Caption:= 'Дата ' + dateToStr(date); Label11.Caption:='Номер заказа: '+ intToStr(nzak); Label9.Caption:= 'Время ' + TimeToStr(Time); end; procedure TForm1.SpeedButton11Click(Sender: TObject); begin if (Edit1.Text='')or(Edit2.Text='')or(Memo1.Text='') then showmessage('Не введены обязательные параметры!') else if (MaskEdit3.Text=' - - ') and (MaskEdit2.Text='(8) ')then showmessage('Введите хотя бы один номер телефона!') else begin fiozam:=Edit1.Text; fiozak:=Edit2.Text; adres:=Memo1.Text; domtel:=MaskEdit3.Text; sottel:=MaskEdit2.Text; data:=datetostr(DateTimePicker1.Date); got:=memo4.Text; Form7.Showmodal; end; end; procedure TForm1.N20Click(Sender: TObject); begin form5.Showmodal; end; procedure TForm1.FormCreate(Sender: TObject); var f:textfile;s:string; begin CheckEvent := TEvent.Create(nil, false, true, 'MYPROGRAM_CHECKEXIST'); if CheckEvent.WaitFor(10) <> wrSignaled then begin Showmessage('Программа уже запущена!'); Self.Close; halt; end; DateTimePicker1.Date:=Date; odn:=''; dir:=ExtractFilePath(Application.ExeName); AssignFile(f,dir+'\nzak.txt'); Reset(f); Read(f,s); nzak:=StrToInt(s); CloseFile(f); end; function Search_And_Replace(RichEdit: TRichEdit; SearchText, ReplaceText: string): Boolean; var startpos, Position, endpos: integer; begin startpos := 0; with RichEdit do begin endpos := Length(RichEdit.Text); Lines.BeginUpdate; while FindText(SearchText, startpos, endpos, [stMatchCase])<>-1 do begin endpos := Length(RichEdit.Text) - startpos; Position := FindText(SearchText, startpos, endpos, [stMatchCase]); Inc(startpos, Length(SearchText)); SetFocus; SelStart := Position; SelLength := Length(SearchText); richedit.clearselection; SelText := ReplaceText; end; Lines.EndUpdate; end; end; procedure TForm1.SpeedButton13Click(Sender: TObject); Var b,a:string; begin if (fiozam='')or(fiozak='')or(adres='') then showmessage('Не введены обязательные параметры!') else if prof='' then Showmessage('Введите информацию о заказе!')else begin RichEdit1.Lines.LoadFromFile(dir+'\Отчеты\ЕвроДом.rtf'); Search_And_Replace(Richedit1, '№1',prof ); Search_And_Replace(Richedit1, '№2',spak); Search_And_Replace(Richedit1, '№4',mon); Search_And_Replace(Richedit1, '№3',got ); if (SOB='')and(Lam='')and(So9='') then b:='' else if (SOB='')or(Lam='')or(So9='') then begin if SOB='' then b:=Lam+'; '+So9+'; '+ton; if Lam='' then b:=SOB+'; '+So9+'; '+ton; if So9='' then b:=SOB+'; '+Lam+'; '+ton; if (Lam='')and(So9='') then b:=SOB+'; '+ton end else b:=SOB+'; '+Lam+'; '+So9+'; '+ton; Search_And_Replace(Richedit1, '#B',b); a:=MarkP+'('+RazPod+')'+Podsen+'у.е'; if a='()у.е' then a:=''; Search_And_Replace(Richedit1, '#A',a ); if sottel='(8) ' then Search_And_Replace(Richedit1, '#6',' ') else Search_And_Replace(Richedit1, '#6',sottel); Search_And_Replace(Richedit1, '#C',itog); Search_And_Replace(Richedit1, '#5',domtel); Search_And_Replace(Richedit1, '#1',fiozam ); Search_And_Replace(Richedit1, '#2',data); Search_And_Replace(Richedit1, '#3',fiozak ); Search_And_Replace(Richedit1, '#4',adres ); end; end; procedure TForm1.SpeedButton9Click(Sender: TObject); begin RichEdit1.Perform(EM_UNDO, 0, 0);end; procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char); var //цифровая маска vrLength, vrSelStart: byte; begin with Sender as TEdit do begin vrLength := Length(Text); //определяем длину текста vrSelStart := SelStart; //определяем положение курсора end; case Key of 'А'..'Я':begin end; 'а'..'я':begin end; #8:begin end; #32:begin end; #46: else Key := #0; //"погасить" все остальные клавиши end;end; procedure TForm1.Edit2KeyPress(Sender: TObject; var Key: Char); var //цифровая маска vrLength, vrSelStart: byte; begin with Sender as TEdit do begin vrLength := Length(Text); vrSelStart := SelStart; end; case Key of 'А'..'Я':begin end; 'а'..'я':begin end; #8:begin end; #32:begin end; #46: else Key := #0; //"погасить" все остальные клавиши end;end; procedure TForm1.SpeedButton8Click(Sender: TObject); begin RichEdit1.Print('Печать отчета'); end; procedure TForm1.SpeedButton14Click(Sender: TObject); begin if RichEdit1.Text<>'' then begin form10.qrimage1.Picture.LoadFromFile(dir+'\temp\'+'1.bmp'); form10.qrimage2.Picture.LoadFromFile(dir+'\temp\'+'2.bmp'); form10.qrimage3.Picture.LoadFromFile(dir+'\temp\'+'3.bmp'); form10.qrimage4.Picture.LoadFromFile(dir+'\temp\'+'4.bmp'); form10.qrimage5.Picture.LoadFromFile(dir+'\temp\'+'5.bmp'); form10.qrimage6.Picture.LoadFromFile(dir+'\temp\'+'6.bmp'); form10.Show; end else Showmessage('Сначала создайте отчёт!');end;end. unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Buttons, StdCtrls, Spin, jpeg,Unit1, ExtCtrls; type TForm2 = class(TForm) Image1: TImage;GroupBox1: TGroupBox;Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; SpinEdit1: TSpinEdit; SpinEdit2: TSpinEdit; SpinEdit3: TSpinEdit; SpinEdit4: TSpinEdit; SpinEdit5: TSpinEdit; SpinEdit6: TSpinEdit; SpinEdit7: TSpinEdit; SpinEdit8: TSpinEdit; SpinEdit9: TSpinEdit; SpinEdit10: TSpinEdit; SpinEdit11: TSpinEdit; SpinEdit12: TSpinEdit; GroupBox2: TGroupBox; Label10: TLabel; Label11: TLabel; Label12: TLabel; Label13: TLabel; Label14: TLabel; Label15: TLabel;Label16: TLabel; Label17: TLabel; Label18: TLabel; SpinEdit13: TSpinEdit; SpinEdit14: TSpinEdit; SpinEdit15: TSpinEdit; SpinEdit16: TSpinEdit; SpinEdit17: TSpinEdit; SpinEdit18: TSpinEdit; SpinEdit19: TSpinEdit; SpinEdit20: TSpinEdit; SpinEdit21: TSpinEdit; SpinEdit22: TSpinEdit; SpinEdit23: TSpinEdit; SpinEdit24: TSpinEdit; SpeedButton4: TSpeedButton; SpeedButton3: TSpeedButton; SpeedButton2: TSpeedButton; SpeedButton1: TSpeedButton; SpeedButton6: TSpeedButton; SpeedButton7: TSpeedButton; procedure SpeedButton1Click(Sender: TObject); procedure SpeedButton2Click(Sender: TObject); procedure SpeedButton3Click(Sender: TObject); procedure SpeedButton4Click(Sender: TObject); procedure SpeedButton6Click(Sender: TObject); procedure SpeedButton7Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form2: TForm2; implementation uses Unit13, Unit14, Unit21, Unit22; {$R *.dfm} procedure TForm2.SpeedButton1Click(Sender: TObject); begin close; end; procedure TForm2.SpeedButton2Click(Sender: TObject); Var s:string; f:textfile; begin {$I-} AssignFile(f,dir+'\Цены\Окна'); {$I+} If IOResult=0 then begin s:=dir+'\Цены\Окна'; Rewrite(f,s+'\Exprof58mm24.dat'); Writeln(f,SpinEdit1.Value); Writeln(f,SpinEdit2.Value); Writeln(f,SpinEdit3.Value); CloseFile(f); Rewrite(f,s+'\Exprof58mm32.dat'); Writeln(f,SpinEdit4.Value); Writeln(f,SpinEdit5.Value); Writeln(f,SpinEdit6.Value); CloseFile(f); Rewrite(f,s+'\Exprof101mm24.dat'); Writeln(f,SpinEdit7.Value); Writeln(f,SpinEdit8.Value); Writeln(f,SpinEdit9.Value); CloseFile(f); Rewrite(f,s+'\Exprof101mm32.dat'); Writeln(f,SpinEdit10.Value); Writeln(f,SpinEdit11.Value); Writeln(f,SpinEdit12.Value); CloseFile(f); end else Exit; {$I-} AssignFile(f,dir+'\Цены\Двери'); {$I+} If IOResult=0 then begin s:=dir+'\Цены\Двери'; Rewrite(f,s+'\Exprof58mm24.dat'); Writeln(f,SpinEdit13.Value); Writeln(f,SpinEdit14.Value); Writeln(f,SpinEdit15.Value); CloseFile(f); Rewrite(f,s+'\Exprof58mm32.dat'); Writeln(f,SpinEdit16.Value); Writeln(f,SpinEdit17.Value); Writeln(f,SpinEdit18.Value); CloseFile(f); Rewrite(f,s+'\Exprof101mm24.dat'); Writeln(f,SpinEdit19.Value); Writeln(f,SpinEdit20.Value); Writeln(f,SpinEdit21.Value); CloseFile(f); Rewrite(f,s+'\Exprof101mm32.dat'); Writeln(f,SpinEdit22.Value); Writeln(f,SpinEdit23.Value); Writeln(f,SpinEdit24.Value); CloseFile(f); end else Exit; ShowMessage('Данные сохранены успешно!'); end; procedure TForm2.SpeedButton3Click(Sender: TObject); begin SpinEdit1.Value:=58; SpinEdit2.Value:=167; SpinEdit3.Value:=172; SpinEdit4.Value:=67; SpinEdit5.Value:=175; SpinEdit6.Value:=181; SpinEdit7.Value:=68; SpinEdit8.Value:=195; SpinEdit9.Value:=201; SpinEdit10.Value:=79; SpinEdit11.Value:=204; SpinEdit12.Value:=212; SpinEdit13.Value:=152; SpinEdit14.Value:=157; SpinEdit15.Value:=176; SpinEdit16.Value:=165; SpinEdit17.Value:=170; SpinEdit18.Value:=187; SpinEdit19.Value:=180; SpinEdit20.Value:=188; SpinEdit21.Value:=0; SpinEdit22.Value:=194; SpinEdit23.Value:=200;SpinEdit24.Value:=0; end; procedure TForm2.SpeedButton4Click(Sender: TObject); begin form13.show; end; procedure TForm2.SpeedButton6Click(Sender: TObject); begin form21.Show; end; procedure TForm2.SpeedButton7Click(Sender: TObject); begin form22.Show; end; end. unit Unit3; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Buttons, jpeg, ExtCtrls; type TForm3 = class(TForm) Image1: TImage; Label1: TLabel; Label2: TLabel; Label3: TLabel;
|