Сущность проектируемой автоматизированной системы

Автор работы: Пользователь скрыл имя, 30 Ноября 2010 в 22:19, Не определен

Описание работы

Курсовой проект

Файлы: 1 файл

Куровая по проектированию.doc

— 1.18 Мб (Скачать файл)

           tab.columns.item(9).width:=80; 
     

           tab.cell(1,1).range.text:='№'; 

           for i:=2 to 9 do

             tab.cell(1,i).range.text:=dbGrid1.Columns[i-1].Title.caption;

            i:=2;

            Query1.First; 

             while not(Query1.Eof) do

              begin

             tab.rows.add; 

            tab.cell(i,1).range.text:=Form6.Table1.fieldbyName('N').AsString;

            tab.cell(i,2).range.text:=Form6.Table1.fieldbyName('Fam').AsString;

            tab.cell(i,3).range.text:=Form6.Table1.fieldbyName('Im').AsString;

            tab.cell(i,4).range.text:=Form6.Table1.fieldbyName('Ot').AsString;

            tab.cell(i,5).range.text:=Form6.Table1.fieldbyName('Dr').AsString;

            tab.cell(i,6).range.text:=Form6.Table1.fieldbyName('Adr').AsString;

            tab.cell(i,7).range.text:=Form6.Table1.fieldbyName('Obr').AsString;

            tab.cell(i,8).range.text:=Form6.Table1.fieldbyName('Dol').AsString;

            tab.cell(i,9).range.text:=Form6.Table1.fieldbyName('Npr').AsString; 
     

            form6.Query1.Next;

           i:=i+1;

           end; 

           tab.rows.item(i).delete;

           end; 

           procedure TForm6.Button3Click(Sender: TObject);

           begin

            DataSource1.DataSet:=Query1;

             Query1.Active:=False;

                 Query1.SQL.Clear;

                 Query1.SQL.Add('SELECT * FROM Laborant' );

                 Query1.Active:=True;

           end; 

           end.

           end; 

           end.

            Программный код  формы № 6

           unit Unit7; 

           interface 

           uses

             Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

             Dialogs, ExtCtrls, DBCtrls, Grids, DBGrids, DB, DBTables, StdCtrls, jpeg,

             Buttons,  ToolWin, ComCtrls, ADODB, ComObj; 

           type 

             TForm7 = class(TForm)

                Query1: TQuery;

               RadioGroup1: TRadioGroup;

               Edit1: TEdit;

               Button1: TButton;

               Table1: TTable;

               DataSource1: TDataSource;

               DBGrid1: TDBGrid; 

               DBNavigator1: TDBNavigator;

               BitBtn1: TBitBtn;

               Button2: TButton;

               Image1: TImage;

               procedure Button2Click(Sender: TObject);

               procedure BitBtn1Click(Sender: TObject);

               procedure Button1Click(Sender: TObject);

             private

               { Private declarations }

             public

               { Public declarations }

             end; 

           var

             Form7: TForm7;

              dm,w,tab: variant;

           implementation 

           //uses dmBook, editBook; 

           {$R *.dfm} 

           procedure TForm7.Button2Click(Sender: TObject);

           begin

           //close;

           DataSource1.DataSet:=Query1;

             Query1.Active:=False;

                 Query1.SQL.Clear;

                 Query1.SQL.Add('SELECT * FROM Grup');

                 Query1.Active:=True;

           end; 

           procedure TForm7.BitBtn1Click(Sender: TObject);

           var

           i:integer; 
     

             begin

           w:=CreateOleObject('Word.Application');

           w.Visible:=true;

           w.Documents.Add;

           tab:=w.ActiveDocument.Tables.Add(Range:=w.ActiveDocument.range, NumRows:=2, NumColumns:=6);

           tab.Autoformat (Format:=31); 

           tab.columns.item(1).width:=25;

           tab.columns.item(2).width:=50;

           tab.columns.item(3).width:=100;

           tab.columns.item(4).width:=110;

           tab.columns.item(5).width:=120;

           tab.cell(1,1).range.text:='№'; 

           for i:=1 to 5 do

             tab.cell(1,i+1).range.text:=dbGrid1.Columns[i-1].Title.caption;

            i:=2;

            Query1.First; 

             while not(Query1.Eof) do

              begin

             tab.rows.add;

            tab.cell(i,1).range.text:=i-1;

            tab.cell(i,2).range.text:=Form7.Table1.fieldbyName('NAIMGR').AsString;

            tab.cell(i,3).range.text:=Form7.Table1.fieldbyName('spez').AsString;

            tab.cell(i,4).range.text:=Form7.Table1.fieldbyName('KLRUK').AsString;

            tab.cell(i,5).range.text:=Form7.Table1.fieldbyName('OTD').AsString;

            tab.cell(i,6).range.text:=Form7.Table1.fieldbyName('Zavotd').AsString;

            form7.Query1.Next; 

           i:=i+1;

           end;

           tab.rows.item(i).delete;

           end; 
     

           procedure Tform7.Button1Click(Sender: TObject);

           begin

           DataSource1.DataSet:=Query1;

           case RadioGroup1.ItemIndex of 

             0:begin

                 Query1.Active:=False;

                 Query1.SQL.Clear;

                 Query1.SQL.Add('SELECT * FROM buchgal WHERE Podrasd='+#39+Edit1.Text+#39);

                 Query1.Active:=True;

               end;

             1:begin

                 Query1.Active:=False;

                 Query1.SQL.Clear;

                 Query1.SQL.Add('SELECT * FROM buchgal WHERE Fio='+#39+Edit1.Text+#39);

                 Query1.Active:=True;

               end;

             2:begin

                 Query1.Active:=False;

                 Query1.SQL.Clear;

                 Query1.SQL.Add('SELECT * FROM buchgal WHERE Liz_schet='+#39+Edit1.Text+#39);

                 Query1.Active:=True;

               end;

             3:begin

                 Query1.Active:=False;

                 Query1.SQL.Clear;

                 Query1.SQL.Add('SELECT * FROM buchgal WHERE ZAVOTD='+#39+Edit1.Text+#39);

                 Query1.Active:=True;

               end;

               end; 

            end; 

           end. 

           Программный код формы 7:

           unit Unit8; 

           interface 

           uses

             Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

             Dialogs, Menus,ShellApi, jpeg, ExtCtrls, StdCtrls; 

           type

             TForm8 = class(TForm)

               MainMenu1: TMainMenu;

               N1: TMenuItem;

               N2: TMenuItem;

               N3: TMenuItem;

               N11: TMenuItem;

               N12: TMenuItem;

               N9: TMenuItem;

               N10: TMenuItem;

               N4: TMenuItem;

               N5: TMenuItem;

               N6: TMenuItem;

               Image1: TImage;

               N7: TMenuItem;

               N8: TMenuItem;

               N13: TMenuItem;

               procedure N2Click(Sender: TObject);

               procedure N3Click(Sender: TObject);

               procedure N11Click(Sender: TObject);

               procedure N12Click(Sender: TObject);

               procedure N4Click(Sender: TObject);

               procedure N6Click(Sender: TObject);

               procedure N7Click(Sender: TObject);

               procedure N8Click(Sender: TObject);

               procedure N61Click(Sender: TObject); 

               procedure N5Click(Sender: TObject);

               procedure N13Click(Sender: TObject);

             private

               { Private declarations }

             public

               { Public declarations }

             end; 

           var

             Form8: TForm8; 

           implementation 

           uses Unit7, Unit5, Unit2, Unit3, Unit6, Unit1; 

           {$R *.dfm} 

           procedure TForm8.N2Click(Sender: TObject);

           begin

           form2.Visible:=true;

           end; 

           procedure TForm8.N3Click(Sender: TObject);

           begin

           form3.Visible:=true;

           end; 

           procedure TForm8.N11Click(Sender: TObject);

Информация о работе Сущность проектируемой автоматизированной системы