да насчет 9 мая... это короста на компе была... добавила текст без моего ведома...
вот:
- Код: Выделить всё
program project1;
{$mode objfpc}{$H+}
uses
Interfaces, // this includes the LCL widgetset
Forms
{ add your units here }, Unit1, Unit2, fiblaz, Unit3, Unit4, Unit5, Unit6,
Unit7, DBFLaz, Unit8, Unit9, Unit10, Printer4Lazarus, Unit11, Unit12, Unit13,
Unit14, Unit15, InterbaseLaz, Unit16, RunTimeTypeInfoControls, Unit17, Unit18,
Unit19, Unit20;
begin
Application.Initialize;
Application.CreateForm(TDataModule1, DataModule1);
Application.CreateForm(TForm19, Form19);
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.CreateForm(TForm3, Form3);
Application.CreateForm(TForm4, Form4);
Application.CreateForm(TForm5, Form5);
Application.CreateForm(TForm6, Form6);
Application.CreateForm(TForm7, Form7);
Application.CreateForm(TForm8, Form8);
Application.CreateForm(TForm9, Form9);
Application.CreateForm(TForm10, Form10);
Application.CreateForm(TForm11, Form11);
Application.CreateForm(TForm12, Form12);
Application.CreateForm(TForm13, Form13);
Application.CreateForm(TForm14, Form14);
Application.CreateForm(TForm15, Form15);
Application.CreateForm(TForm16, Form16);
Application.CreateForm(TForm17, Form17);
Application.CreateForm(TForm18, Form18);
Application.Run;
end.
сначала создается 19 форма... на ней ComboBox1 и Edit1... и кнопка... а в кнопке написано:
- Код: Выделить всё
procedure TForm19.Button1Click(Sender: TObject);
var
d: TDateTime;
a: integer;
begin
form8.MenuItem10.Visible := True;
DataModule1.FIBDataSet1.First;
if DataModule1.FIBDataSet1.FieldByName('ID').AsInteger = 0 then
begin
Form8.MenuItem5.Visible := False;
Form8.MenuItem9.Visible := False;
Form8.MenuItem4.Visible := False;
Form8.MenuItem5.Visible := False;
end;
name_sclad := ComboBox1.Text;
if (combobox1.Text = 'admin') and (Edit1.Text = 'admin180683')then
Begin
DataModule1.FIBDataSet4.First;
Form1.Edit1.Text := DataModule1.FIBDataSet4.FieldByName('CGP').AsString;
Form9.Hide;
Form1.Show;
End;
if (combobox1.Text = 'admin') and (Edit1.Text = 'admin') then
Begin
Form4.Show;
DataModule1.FIBDataSet4.First;
Form4.MenuItem2.Visible := False;
Form4.MenuItem4.Visible := False;
Form4.MenuItem7.Visible := False;
Form4.MenuItem9.Visible := False;
Form4.Edit14.Text := DataModule1.FIBDataSet4.FieldByName('CGP').AsString;
Form4.ComboBox3.Text := 'Проба';
Form4.ComboBox4.Text := 'Наименование изделия';
Form4.ComboBox3.Items.LoadFromFile('prob');
Form4.ComboBox4.Items.LoadFromFile('vid_sprav');
Form4.Caption := 'Выдача товара на склады';
d := Now;
Form4.Edit3.ReadOnly := False;
Form4.Edit3.Text := FormatDateTime('dd.mm.yyyy', d);
Form4.Button3Click(nil);
Form4.Button5Click(nil);
Form4.Edit1.Text := '';
Form4.ComboBox4.Text := '';
Form4.Edit4.Text := '';
Form4.Edit6.Text := '';
Form4.Edit7.Text := '';
DataModule1.Dbf17.Edit;
DataModule1.Dbf17.First;
While not DataModule1.Dbf17.EOF do
begin
DataModule1.Dbf17.Delete;
end;
End;
if (combobox1.Text = 'admin') and (Edit1.Text = '') then
Begin
Form4.Show;
DataModule1.FIBDataSet4.First;
Form4.MenuItem2.Visible := False;
Form4.MenuItem4.Visible := False;
Form4.MenuItem7.Visible := False;
Form4.MenuItem9.Visible := False;
Form4.Edit14.Text := DataModule1.FIBDataSet4.FieldByName('CGP').AsString;
Form4.ComboBox3.Text := 'Проба';
Form4.ComboBox4.Text := 'Наименование изделия';
Form4.ComboBox3.Items.LoadFromFile('prob');
Form4.ComboBox4.Items.LoadFromFile('vid_sprav');
Form4.Caption := 'Выдача товара на склады';
d := Now;
Form4.Edit3.ReadOnly := False;
Form4.Edit3.Text := FormatDateTime('dd.mm.yyyy', d);
Form4.Button3Click(nil);
Form4.Button5Click(nil);
Form4.Edit1.Text := '';
Form4.ComboBox4.Text := '';
Form4.Edit4.Text := '';
Form4.Edit6.Text := '';
Form4.Edit7.Text := '';
Form4.ComboBox2.Items.LoadFromFile('items');
DataModule1.Dbf17.Last;
Form4.Edit3.Text := DataModule1.Dbf17.FieldByName('data_s').AsString;
Form4.ComboBox2.Text := DataModule1.Dbf17.FieldByName('name_s').AsString;
Form4.Edit3.ReadOnly := True;
Form4.ComboBox2.ReadOnly := True;
id_sclad := DataModule1.Dbf17.FieldByName('sclad_id').AsInteger;
DataModule1.FIBDataSet4.First;
a := 1;
While (not DataModule1.FIBDataSet4.EOF) and (a = 1) do
Begin
If DataModule1.FIBDataSet4.FieldByName('s_id').AsInteger = id_sclad then
begin
a := 0;
end;
DataModule1.FIBDataSet4.Next;
End;
DataModule1.FIBDataSet4.Prior;
End;
DataModule1.FIBDataSet2.First;
While not DataModule1.FIBDataSet2.EOF do
Begin
if combobox1.Text = DataModule1.FIBDataSet2.FieldByName('name').AsString then
Begin
if DataModule1.FIBDataSet2.FieldByName('obmen').AsString = '1' then
Begin
Form8.GroupBox6.Visible := False;
Form8.GroupBox7.Visible := False;
Form8.Label33.Visible := False;
Form8.Label36.Visible := False;
Form8.Label37.Visible := False;
Form8.Label7.Visible := False;
Form8.Label17.Visible := False;
Form8.Label10.Visible := False;
End;
if DataModule1.FIBDataSet2.FieldByName('obmen').AsString = '0' then
Begin
Form8.GroupBox6.Visible := True;
Form8.GroupBox7.Visible := True;
Form8.Label33.Visible := True;
Form8.Label36.Visible := True;
Form8.Label37.Visible := True;
Form8.Label7.Visible := True;
Form8.Label17.Visible := True;
Form8.Label10.Visible := True;
End;
idus := DataModule1.FIBDataSet2.FieldByName('id').AsInteger;
Form8.ComboBox2.Items.LoadFromFile('user');
Form9.Hide;
Form8.Show;
End;
DataModule1.FIBDataSet2.Next;
End;
ComboBox1.Text := '';
Edit1.Text := '';
end;
и когда должно выполнятся условие admin admin или admin '' то показуетса четвертая форма...
пробывал в Project1.lpr написать так:
- Код: Выделить всё
Application.Initialize;
Application.CreateForm(TDataModule1, DataModule1);
Application.CreateForm(TForm4, Form4);
Application.CreateForm(TForm19, Form19);
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TForm2, Form2);
Application.CreateForm(TForm3, Form3);
Application.CreateForm(TForm5, Form5);
Application.CreateForm(TForm6, Form6);
Application.CreateForm(TForm7, Form7);
Application.CreateForm(TForm8, Form8);
Application.CreateForm(TForm9, Form9);
Application.CreateForm(TForm10, Form10);
Application.CreateForm(TForm11, Form11);
Application.CreateForm(TForm12, Form12);
Application.CreateForm(TForm13, Form13);
Application.CreateForm(TForm14, Form14);
Application.CreateForm(TForm15, Form15);
Application.CreateForm(TForm16, Form16);
Application.CreateForm(TForm17, Form17);
Application.CreateForm(TForm18, Form18);
Application.Run;
и тогда программа не запускаетса...
но раньше работало... ё в м...